mirror of
https://github.com/oliverbooth/VpSharp
synced 2024-11-26 10:28:47 +00:00
15 lines
443 B
C#
15 lines
443 B
C#
|
namespace VpSharp.Commands.Attributes.ExecutionChecks;
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// Specifies that this command can only be run by bots.
|
|||
|
/// </summary>
|
|||
|
public sealed class RequireBotAttribute : PreExecutionCheckAttribute
|
|||
|
{
|
|||
|
/// <inheritdoc />
|
|||
|
protected internal override Task<bool> PerformAsync(CommandContext context)
|
|||
|
{
|
|||
|
ArgumentNullException.ThrowIfNull(context);
|
|||
|
return Task.FromResult(context.Avatar.IsBot);
|
|||
|
}
|
|||
|
}
|