Class ApplicationCommandRequirePermissionsAttribute
Defines that usage of this application command is restricted to members with specified permissions. This check also verifies that the bot has the same permissions.
Inheritance
System.Object
System.Attribute
ApplicationCommandRequirePermissionsAttribute
Namespace: DisCatSharp.ApplicationCommands.Attributes
Assembly: DisCatSharp.ApplicationCommands.dll
Syntax
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = false)]
public sealed class ApplicationCommandRequirePermissionsAttribute : SlashCheckBaseAttribute
Constructors
| Improve this Doc View SourceApplicationCommandRequirePermissionsAttribute(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 ApplicationCommandRequirePermissionsAttribute(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 SourceIgnoreDms
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 |
Permissions
Gets the permissions required by this attribute.
Declaration
public Permissions Permissions { get; }
Property Value
Type | Description |
---|---|
Permissions |
Methods
| Improve this Doc View SourceExecuteChecksAsync(InteractionContext)
Runs checks.
Declaration
public override async Task<bool> ExecuteChecksAsync(InteractionContext ctx)
Parameters
Type | Name | Description |
---|---|---|
InteractionContext | ctx |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Boolean> |