mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 17:28:27 -04:00
Fixed nullref in cmdcd
This commit is contained in:
@@ -29,8 +29,11 @@ public sealed class CmdCdService : IExecPreCommand, IReadyExecutor, INService
|
|||||||
public Task<bool> ExecPreCommandAsync(ICommandContext context, string moduleName, CommandInfo command)
|
public Task<bool> ExecPreCommandAsync(ICommandContext context, string moduleName, CommandInfo command)
|
||||||
=> TryBlock(context.Guild, context.User, command.Name.ToLowerInvariant());
|
=> TryBlock(context.Guild, context.User, command.Name.ToLowerInvariant());
|
||||||
|
|
||||||
public Task<bool> TryBlock(IGuild guild, IUser user, string commandName)
|
public Task<bool> TryBlock(IGuild? guild, IUser user, string commandName)
|
||||||
{
|
{
|
||||||
|
if (guild is null)
|
||||||
|
return Task.FromResult(false);
|
||||||
|
|
||||||
if (!_settings.TryGetValue(guild.Id, out var cooldownSettings))
|
if (!_settings.TryGetValue(guild.Id, out var cooldownSettings))
|
||||||
return Task.FromResult(false);
|
return Task.FromResult(false);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user