Table of Contents

Class RequireRolesAttribute

Namespace
DSharpPlus.CommandsNext.Attributes
Assembly
DSharpPlus.CommandsNext.dll

Defines that usage of this command is restricted to members with specified role. Note that it's much preferred to restrict access using RequirePermissionsAttribute.

[AttributeUsage(AttributeTargets.Class|AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
public sealed class RequireRolesAttribute : CheckBaseAttribute
Inheritance
object
Attribute
RequireRolesAttribute

Constructors

RequireRolesAttribute(RoleCheckMode, params 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.

RequireRolesAttribute(RoleCheckMode, string[], ulong[])

Defines that usage of this command is restricted to members with the specified role. Note that it is much preferred to restrict access using RequirePermissionsAttribute.

RequireRolesAttribute(RoleCheckMode, params ulong[])

Defines that usage of this command is restricted to members with the specified role. Note that it is much preferred to restrict access using RequirePermissionsAttribute.

Properties

CheckMode

Gets the role checking mode. Refer to RoleCheckMode for more information.

RoleIds

Gets the IDs of roles required to execute this command.

RoleNames

Gets the names of roles required to execute this command.

Methods

ExecuteCheckAsync(CommandContext, bool)

Asynchronously checks whether this command can be executed within given context.