Search Results for

    Show / Hide Table of Contents

    Class RequirePermissionsAttribute

    Defines that usage of this command is restricted to members with specified permissions. This check also verifies that the bot has the same permissions.

    Inheritance
    System.Object
    System.Attribute
    CheckBaseAttribute
    RequirePermissionsAttribute
    Namespace: DisCatSharp.CommandsNext.Attributes
    Assembly: DisCatSharp.CommandsNext.dll
    Syntax
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = false)]
    public sealed class RequirePermissionsAttribute : CheckBaseAttribute

    Constructors

    | Improve this Doc View Source

    RequirePermissionsAttribute(Permissions, Boolean)

    Defines that usage of this command is restricted to members with specified permissions. This check also verifies that the bot has the same permissions.

    Declaration
    public RequirePermissionsAttribute(Permissions permissions, bool ignoreDms = true)
    Parameters
    Type Name Description
    Permissions permissions

    Permissions required to execute this command.

    System.Boolean ignoreDms

    Sets this check's behaviour in DMs. True means the check will always pass in DMs, whereas false means that it will always fail.

    Properties

    | Improve this Doc View Source

    IgnoreDms

    Gets or sets this check's behaviour in DMs. True means the check will always pass in DMs, whereas false means that it will always fail.

    Declaration
    public bool IgnoreDms { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Permissions

    Gets the permissions required by this attribute.

    Declaration
    public Permissions Permissions { get; }
    Property Value
    Type Description
    Permissions

    Methods

    | Improve this Doc View Source

    ExecuteCheckAsync(CommandContext, Boolean)

    Executes the a check.

    Declaration
    public override async Task<bool> ExecuteCheckAsync(CommandContext ctx, bool help)
    Parameters
    Type Name Description
    CommandContext ctx

    The command context.

    System.Boolean help

    If true, help - returns true.

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Boolean>
    Overrides
    CheckBaseAttribute.ExecuteCheckAsync(CommandContext, Boolean)

    Extension Methods

    ReflectionUtilities.ToDictionary<T>(T)
    • Improve this Doc
    • View Source
    In This Article
    Back to top © 2021-2022 Aiko IT Systems