Class RequirePrefixesAttribute
Defines that usage of this command is only allowed with specific prefixes.
Namespace: DisCatSharp.CommandsNext.Attributes
Assembly: DisCatSharp.CommandsNext.dll
Syntax
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = false)]
public sealed class RequirePrefixesAttribute : CheckBaseAttribute
Constructors
| Improve this Doc View SourceRequirePrefixesAttribute(String[])
Defines that usage of this command is only allowed with specific prefixes.
Declaration
public RequirePrefixesAttribute(params string[] prefixes)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | prefixes | Prefixes with which the execution of this command is allowed. |
Properties
| Improve this Doc View SourcePrefixes
Gets the array of prefixes with which execution of this command is allowed.
Declaration
public string[] Prefixes { get; }
Property Value
Type | Description |
---|---|
System.String[] |
ShowInHelp
Gets or sets default help behaviour for this check. When this is enabled, invoking help without matching prefix will show the commands.
Defaults to false.
Declaration
public bool ShowInHelp { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
| Improve this Doc View SourceExecuteCheckAsync(CommandContext, Boolean)
Executes the a check.
Declaration
public override 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> |