Class RequireRolesAttribute
Defines that usage of this command is restricted to members with specified role. Note that it's much preferred to restrict access using RequirePermissionsAttribute.
Namespace: DSharpPlus.CommandsNext.Attributes
Assembly: cs.temp.dll.dll
Syntax
public sealed class RequireRolesAttribute : CheckBaseAttribute
Constructors
RequireRolesAttribute(RoleCheckMode, String[])
Defines that usage of this command is restricted to members with specified role. Note that it's much preferred to restrict access using RequirePermissionsAttribute.
Declaration
public RequireRolesAttribute(RoleCheckMode checkMode, params string[] roleNames)
Parameters
Type | Name | Description |
---|---|---|
RoleCheckMode | checkMode | Role checking mode. |
System.String[] | roleNames | Names of the role to be verified by this check. |
Properties
CheckMode
Gets the role checking mode. Refer to RoleCheckMode for more information.
Declaration
public RoleCheckMode CheckMode { get; }
Property Value
Type | Description |
---|---|
RoleCheckMode |
RoleNames
Gets the name of the role required to execute this command.
Declaration
public IReadOnlyList<string> RoleNames { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<System.String> |
Methods
ExecuteCheckAsync(CommandContext, Boolean)
Declaration
public override Task<bool> ExecuteCheckAsync(CommandContext ctx, bool help)
Parameters
Type | Name | Description |
---|---|---|
CommandContext | ctx | |
System.Boolean | help |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Boolean> |