1
0
mirror of https://github.com/oliverbooth/VpSharp synced 2024-11-13 02:55:42 +00:00
VpSharp/VpSharp.Commands/Attributes/ExecutionChecks/RequireHumanAttribute.cs

15 lines
444 B
C#
Raw Normal View History

2022-12-05 01:43:40 +00:00
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)
{
ArgumentNullException.ThrowIfNull(context);
return Task.FromResult(!context.Avatar.IsBot);
}
}