mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-11 00:07:55 +00:00
Fix compiler warnings CS1998 and CS4014
This commit is contained in:
parent
a078fcdf47
commit
4fe80749c4
5 changed files with 25 additions and 24 deletions
|
|
@ -220,14 +220,14 @@ namespace PluralKit.Bot
|
|||
{
|
||||
}
|
||||
|
||||
public override async Task<PreconditionResult> CheckPermissionsAsync(ICommandContext context, CommandInfo command, IServiceProvider services)
|
||||
public override Task<PreconditionResult> CheckPermissionsAsync(ICommandContext context, CommandInfo command, IServiceProvider services)
|
||||
{
|
||||
// This stops the "delegating command" we define above from being called multiple times
|
||||
// If we've already added a context object to the context, then we'll return with the same
|
||||
// error you get when there's an invalid command - it's like it didn't exist
|
||||
// This makes sure the user gets the proper error, instead of the command trying to parse things weirdly
|
||||
if ((context as PKCommandContext)?.GetContextEntity<object>() == null) return PreconditionResult.FromSuccess();
|
||||
return PreconditionResult.FromError(command.Module.Service.Search("<unknown>"));
|
||||
if ((context as PKCommandContext)?.GetContextEntity<object>() == null) return Task.FromResult(PreconditionResult.FromSuccess());
|
||||
return Task.FromResult(PreconditionResult.FromError(command.Module.Service.Search("<unknown>")));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue