Class SlashCommandAttribute
Marks this method as a slash command
Inheritance
Namespace: DisCatSharp.ApplicationCommands
Assembly: DisCatSharp.ApplicationCommands.dll
Syntax
[AttributeUsage(AttributeTargets.Method)]
public class SlashCommandAttribute : Attribute
Constructors
| Improve this Doc View SourceSlashCommandAttribute(String, String, Boolean)
Marks this method as a slash command
Declaration
public SlashCommandAttribute(string name, string description, bool isNsfw = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of this slash command. |
System.String | description | The description of this slash command. |
System.Boolean | isNsfw | Whether this command is marked as NSFW. |
SlashCommandAttribute(String, String, Boolean, Boolean)
Marks this method as a slash command
Declaration
public SlashCommandAttribute(string name, string description, bool dmPermission, bool isNsfw = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of this slash command. |
System.String | description | The description of this slash command. |
System.Boolean | dmPermission | The dm permission. |
System.Boolean | isNsfw | Whether this command is marked as NSFW. |
SlashCommandAttribute(String, String, Int64, Boolean)
Marks this method as a slash command
Declaration
public SlashCommandAttribute(string name, string description, long defaultMemberPermissions, bool isNsfw = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of this slash command. |
System.String | description | The description of this slash command. |
System.Int64 | defaultMemberPermissions | The default member permissions. |
System.Boolean | isNsfw | Whether this command is marked as NSFW. |
SlashCommandAttribute(String, String, Int64, Boolean, Boolean)
Marks this method as a slash command
Declaration
public SlashCommandAttribute(string name, string description, long defaultMemberPermissions, bool dmPermission, bool isNsfw = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of this slash command. |
System.String | description | The description of this slash command. |
System.Int64 | defaultMemberPermissions | The default member permissions. |
System.Boolean | dmPermission | The dm permission. |
System.Boolean | isNsfw | Whether this command is marked as NSFW. |
Properties
| Improve this Doc View SourceDefaultMemberPermissions
Gets the needed permission of this command
Declaration
public Permissions? DefaultMemberPermissions { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<Permissions> |
Description
Gets the description of this command
Declaration
public string Description { get; set; }
Property Value
Type | Description |
---|---|
System.String |
DmPermission
Gets the dm permission of this command
Declaration
public bool? DmPermission { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Boolean> |
IsNsfw
Gets whether this command is marked as NSFW
Declaration
public bool IsNsfw { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Name
Gets the name of this command
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String |