mirror of
https://github.com/oliverbooth/VpSharp
synced 2024-11-26 03:58:48 +00:00
19 lines
504 B
C#
19 lines
504 B
C#
namespace VpSharp.Commands.Attributes.ExecutionChecks;
|
|
|
|
/// <summary>
|
|
/// Specifies that this command cannot be run by bots.
|
|
/// </summary>
|
|
public sealed class RequireHumanAttribute : PreExecutionCheckAttribute
|
|
{
|
|
/// <inheritdoc />
|
|
protected internal override Task<bool> PerformAsync(CommandContext context)
|
|
{
|
|
if (context is null)
|
|
{
|
|
throw new ArgumentNullException(nameof(context));
|
|
}
|
|
|
|
return Task.FromResult(!context.Avatar.IsBot);
|
|
}
|
|
}
|