• Guides
  • Api Documentation
Show / Hide Table of Contents
  • Discord.Addons.MpGame
    • CurrentlyPlaying
    • GameBase<TPlayer>
    • IMpGameData
    • MpGameModuleBase<TService, TGame, TPlayer>
    • MpGameService<TGame, TPlayer>
    • MpGameService<TGame, TPlayer>.MpGameData
    • Player
  • Discord.Addons.MpGame.Collections
    • CircularLinkedList<T>
    • Hand<T>
    • IWrapper<T>
    • Node<T>
    • Pile<T>
    • WrappingPile<T, TWrapper>
  • Discord.Addons.Preconditions
    • Measure
    • MinimumOnlineUsersAttribute
    • RatelimitAttribute
    • RatelimitFlags
    • RequireLowerHierarchyAttribute
    • RequireRoleAttribute
    • UserMustBeInVoiceAttribute

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
Object
Attribute
PreconditionAttribute
RequireContextAttribute
RequireRoleAttribute
Inherited Members
RequireContextAttribute.Contexts
RequireContextAttribute.ErrorMessage
PreconditionAttribute.Group
Namespace: Discord.Addons.Preconditions
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
Type Name Description
ICommandContext context
CommandInfo command
IServiceProvider services
Returns
Type Description
Task<PreconditionResult>
Overrides
RequireContextAttribute.CheckPermissionsAsync(ICommandContext, CommandInfo, IServiceProvider)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX