| @@ -1,13 +1,19 @@ | |||||
| //You can put commands in groups | |||||
| [Group("group-name", "Group description")] | [Group("group-name", "Group description")] | ||||
| public class CommandGroupModule : InteractionModuleBase<SocketInteractionContext> | public class CommandGroupModule : InteractionModuleBase<SocketInteractionContext> | ||||
| { | { | ||||
| //This command will look like | |||||
| // group-name ping | |||||
| [SlashCommand("ping", "Get a pong")] | [SlashCommand("ping", "Get a pong")] | ||||
| public async Task PongSubcommand() | public async Task PongSubcommand() | ||||
| => await RespondAsync("Pong!"); | => await RespondAsync("Pong!"); | ||||
| //And even in sub-command groups | |||||
| [Group("subcommand-group-name", "Subcommand group description")] | [Group("subcommand-group-name", "Subcommand group description")] | ||||
| public class SubcommandGroupModule : InteractionModuleBase<SocketInteractionContext> | |||||
| public class SubСommandGroupModule : InteractionModuleBase<SocketInteractionContext> | |||||
| { | { | ||||
| //This command will look like | |||||
| // group-name subcommand-group-name echo | |||||
| [SlashCommand("echo", "Echo an input")] | [SlashCommand("echo", "Echo an input")] | ||||
| public async Task PongSubcommand(string input) | public async Task PongSubcommand(string input) | ||||
| => await RespondAsync(input); | => await RespondAsync(input); | ||||