Class ApplicationCommandRequireOwnerOrIdAttribute
Requires ownership of the bot or a whitelisted id to execute this command.
Inheritance
System.Object
System.Attribute
ApplicationCommandRequireOwnerOrIdAttribute
Namespace: DisCatSharp.ApplicationCommands.Attributes
Assembly: DisCatSharp.ApplicationCommands.dll
Syntax
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = false)]
public sealed class ApplicationCommandRequireOwnerOrIdAttribute : SlashCheckBaseAttribute
Constructors
| Improve this Doc View SourceApplicationCommandRequireOwnerOrIdAttribute(UInt64[])
Defines that usage of this command is restricted to the owner or whitelisted ids of the bot.
Declaration
public ApplicationCommandRequireOwnerOrIdAttribute(params ulong[] userIds)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64[] | userIds | List of allowed user ids |
Properties
| Improve this Doc View SourceUserIds
Allowed user ids
Declaration
public IReadOnlyList<ulong> UserIds { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.UInt64> |
Methods
| Improve this Doc View SourceExecuteChecksAsync(InteractionContext)
Executes the a check.
Declaration
public override Task<bool> ExecuteChecksAsync(InteractionContext ctx)
Parameters
Type | Name | Description |
---|---|---|
InteractionContext | ctx | The command context. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Boolean> |