Class RequireOwnerOrIdAttribute
Requires ownership of the bot or a whitelisted id to execute this command.
Namespace: DisCatSharp.CommandsNext.Attributes
Assembly: DisCatSharp.CommandsNext.dll
Syntax
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = false)]
public sealed class RequireOwnerOrIdAttribute : CheckBaseAttribute
Constructors
| Improve this Doc View SourceRequireOwnerOrIdAttribute(UInt64[])
Defines that usage of this command is restricted to the owner or whitelisted ids of the bot.
Declaration
public RequireOwnerOrIdAttribute(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 SourceExecuteCheckAsync(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> |