Class RequireOwnerAttribute
Requires the command to be invoked by the owner of the bot.
Assembly: Discord.Net.Commands.dll​
View Source​
Declaration
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
public class RequireOwnerAttribute : PreconditionAttribute, _Attribute
Properties​
ErrorMessage​
When overridden in a derived class, uses the supplied string as the error message if the precondition doesn't pass. Setting this for a class that doesn't override this property is a no-op.
View Source​
Declaration
public override string ErrorMessage { get; set; }
Methods​
CheckPermissionsAsync(ICommandContext, CommandInfo, IServiceProvider)​
Checks if the <code data-dev-comment-type="paramref" class="paramref">command</code> has the sufficient permission to be executed.
View Source​
Declaration
public override async Task<PreconditionResult> CheckPermissionsAsync(ICommandContext context, CommandInfo command, IServiceProvider services)
Returns​
System.Threading.Tasks.Task<Discord.Commands.PreconditionResult>
Parameters​
Type | Name | Description |
---|---|---|
Discord.Commands.ICommandContext | context | The context of the command. |
Discord.Commands.CommandInfo | command | The command being executed. |
System.IServiceProvider | services | The service collection used for dependency injection. |
Implements​
System.Runtime.InteropServices._Attribute