mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-12 10:18:27 -04:00
Changed all .GetService to .GetRequiredService because no service should be ever missing. However most of these should be removed in one of the future patches.
This commit is contained in:
@@ -24,7 +24,7 @@ namespace NadekoBot.Common.Attributes
|
||||
if (Seconds == 0)
|
||||
return Task.FromResult(PreconditionResult.FromSuccess());
|
||||
|
||||
var cache = services.GetService<IDataCache>();
|
||||
var cache = services.GetRequiredService<IDataCache>();
|
||||
var rem = cache.TryAddRatelimit(context.User.Id, command.Name, Seconds);
|
||||
|
||||
if(rem is null)
|
||||
|
@@ -23,7 +23,7 @@ namespace Discord
|
||||
|
||||
public override Task<PreconditionResult> CheckPermissionsAsync(ICommandContext context, CommandInfo command, IServiceProvider services)
|
||||
{
|
||||
var permService = services.GetService<DiscordPermOverrideService>();
|
||||
var permService = services.GetRequiredService<DiscordPermOverrideService>();
|
||||
if (permService.TryGetOverrides(context.Guild?.Id ?? 0, command.Name.ToUpperInvariant(), out var _))
|
||||
return Task.FromResult(PreconditionResult.FromSuccess());
|
||||
|
||||
|
Reference in New Issue
Block a user