Wolfringo Wolfringo
Wolfringo Wolfringo
Wolfringo (c) 2020 TehGM
DocFX, DiscordFX theme.
Search Results for

    Class RequireBotUserPrivilegeAttribute

    Command requirement that checks if the bot has correct privileges.

    Inheritance
    System.Object
    System.Attribute
    CommandRequirementAttribute
    RequireBotUserPrivilegeAttribute
    Implements
    ICommandRequirement
    Inherited Members
    CommandRequirementAttribute.ErrorMessage
    CommandRequirementAttribute.AbortOnFail
    CommandRequirementAttribute.SendMessageWhenSkipping
    CommandRequirementAttribute.SuccessResult
    CommandRequirementAttribute.FailureResult
    CommandRequirementAttribute.ResultFromBoolean(Boolean)
    Namespace: TehGM.Wolfringo.Commands.Attributes
    Assembly: Wolfringo.Commands.dll
    Syntax
    public class RequireBotUserPrivilegeAttribute : CommandRequirementAttribute, ICommandRequirement
    Remarks

    Default ErrorMessage for this requirement is "(n) I don't have enough user privileges to execute this command.".

    Constructors

    | Improve this Doc View Source

    RequireBotUserPrivilegeAttribute(WolfPrivilege)

    Creates a new instance of command user privilege requirement.

    Declaration
    public RequireBotUserPrivilegeAttribute(WolfPrivilege privileges)
    Parameters
    Type Name Description
    WolfPrivilege privileges

    Flags of privileges that fulfill this requirement.

    Remarks

    Only one of the privileges has to match. For example, Volunteer | Staff matches if user is either Volunteer or Staff.

    See Also
    Privileges

    Properties

    | Improve this Doc View Source

    Privileges

    Flags of privileges that fulfill this requirement.

    Declaration
    public WolfPrivilege Privileges { get; }
    Property Value
    Type Description
    WolfPrivilege
    Remarks

    Only one of the privileges has to match. For example, Volunteer | Staff matches if user is either Volunteer or Staff.

    Methods

    | Improve this Doc View Source

    CheckAsync(ICommandContext, IServiceProvider, CancellationToken)

    Checks requirement.

    Declaration
    public override async Task<ICommandResult> CheckAsync(ICommandContext context, IServiceProvider services, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    ICommandContext context

    Command to check the requirement for.

    System.IServiceProvider services

    Services that can be used during requirement checks.

    System.Threading.CancellationToken cancellationToken

    Token for cancelling the task.

    Returns
    Type Description
    System.Threading.Tasks.Task<ICommandResult>

    True if requirement was fullfilled; otherwise false.

    Overrides
    CommandRequirementAttribute.CheckAsync(ICommandContext, IServiceProvider, CancellationToken)

    Implements

    ICommandRequirement