Class RequireRoleAttribute
Indicates this command or all commands in this module can only
be executed if the user has the role with the specified Id.
This precondition automatically applies RequireContextAttribute.
Inheritance
RequireRoleAttribute
Assembly: Discord.Addons.Preconditions.dll
Syntax
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public sealed class RequireRoleAttribute : RequireContextAttribute
Constructors
|
Improve this Doc
View Source
RequireRoleAttribute(UInt64)
Declaration
public RequireRoleAttribute(ulong requiredRole)
Parameters
Type |
Name |
Description |
UInt64 |
requiredRole |
|
Methods
|
Improve this Doc
View Source
CheckPermissionsAsync(ICommandContext, CommandInfo, IServiceProvider)
Declaration
public override async Task<PreconditionResult> CheckPermissionsAsync(ICommandContext context, CommandInfo command, IServiceProvider services)
Parameters
Returns
Overrides