diff --git a/VpSharp.Commands/Attributes/ExecutionChecks/RequireBotOwnerAttribute.cs b/VpSharp.Commands/Attributes/ExecutionChecks/RequireBotOwnerAttribute.cs new file mode 100644 index 0000000..d3a54cf --- /dev/null +++ b/VpSharp.Commands/Attributes/ExecutionChecks/RequireBotOwnerAttribute.cs @@ -0,0 +1,14 @@ +namespace VpSharp.Commands.Attributes.ExecutionChecks; + +/// +/// Specifies that this command can only be run by the user under whom this bot is authenticated. +/// +public sealed class RequireBotOwnerAttribute : PreExecutionCheckAttribute +{ + /// + protected internal override Task PerformAsync(CommandContext context) + { + ArgumentNullException.ThrowIfNull(context); + return Task.FromResult(context.Avatar.User.Id == context.Client.CurrentUser?.Id); + } +}