diff --git a/docs/guides/interactions/application-commands/slash-commands/02-creating-slash-commands.md b/docs/guides/interactions/application-commands/slash-commands/02-creating-slash-commands.md index 830c52aa5..1abab1a25 100644 --- a/docs/guides/interactions/application-commands/slash-commands/02-creating-slash-commands.md +++ b/docs/guides/interactions/application-commands/slash-commands/02-creating-slash-commands.md @@ -1,3 +1,8 @@ +--- +uid: Guides.SlashCommands.Creating +title: Creating Slash Commands +--- + # Creating your first slash commands. There are two kinds of Slash Commands: global commands and guild commands. @@ -35,7 +40,10 @@ The slash command builder will help you create slash commands. The builder has t | AddOption | Function | Adds an option to the current slash command. | | Build | Function | Builds the builder into a `SlashCommandCreationProperties` class used to make slash commands | -**Note**: Slash command names must be all lowercase! +> [!NOTE] +> Slash command names must be all lowercase! + +## Creating a Slash Command Let's use the slash command builder to make a global and guild command. @@ -84,4 +92,5 @@ public async Task Client_Ready() ``` -**Note**: Slash commands only need to be created once. They do _not_ have to be 'created' on every startup or connection. The example simple shows creating them in the ready event as it's simpler than creating normal bot commands to register slash commands. +> [!NOTE] +> Slash commands only need to be created once. They do _not_ have to be 'created' on every startup or connection. The example simple shows creating them in the ready event as it's simpler than creating normal bot commands to register slash commands. diff --git a/docs/guides/interactions/application-commands/slash-commands/03-responding-to-slash-commands.md b/docs/guides/interactions/application-commands/slash-commands/03-responding-to-slash-commands.md index ad3c7145b..cd6ad5217 100644 --- a/docs/guides/interactions/application-commands/slash-commands/03-responding-to-slash-commands.md +++ b/docs/guides/interactions/application-commands/slash-commands/03-responding-to-slash-commands.md @@ -1,3 +1,8 @@ +--- +uid: Guides.SlashCommands.Receiving +title: Receiving and Responding to Slash Commands +--- + # Responding to interactions. Interactions are the base thing sent over by Discord. Slash commands are one of the interaction types. In order to receive a slash command we have to listen to the `InteractionCreated` event. Let's add this to our code. @@ -45,6 +50,8 @@ Let's try this out! Let's go over the response types quickly, as you would only change them for style points :P -> After receiving an interaction, you must respond to acknowledge it. You can choose to respond with a message immediately using `RespondAsync()` or you can choose to send a deferred response with `DeferAsync()`. If choosing a deferred response, the user will see a loading state for the interaction, and you'll have up to 15 minutes to edit the original deferred response using `ModifyOriginalResponseAsync()`. You can read more about response types [here](https://discord.com/developers/docs/interactions/slash-commands#interaction-response) +> [!NOTE] +> After receiving an interaction, you must respond to acknowledge it. You can choose to respond with a message immediately using `RespondAsync()` or you can choose to send a deferred response with `DeferAsync()`. +> If choosing a deferred response, the user will see a loading state for the interaction, and you'll have up to 15 minutes to edit the original deferred response using `ModifyOriginalResponseAsync()`. You can read more about response types [here](https://discord.com/developers/docs/interactions/slash-commands#interaction-response) This seems to be working! Next, we will look at parameters for slash commands. diff --git a/docs/guides/interactions/application-commands/slash-commands/04-parameters.md b/docs/guides/interactions/application-commands/slash-commands/04-parameters.md index ddac72203..cc61796c8 100644 --- a/docs/guides/interactions/application-commands/slash-commands/04-parameters.md +++ b/docs/guides/interactions/application-commands/slash-commands/04-parameters.md @@ -1,3 +1,8 @@ +--- +uid: Guides.SlashCommands.Parameters +title: Slash Command Parameters +--- + # Slash command parameters Slash commands can have a bunch of parameters, each their own type. Let's first go over the types of parameters we can have. diff --git a/docs/guides/interactions/application-commands/slash-commands/05-responding-ephemerally.md b/docs/guides/interactions/application-commands/slash-commands/05-responding-ephemerally.md index f92504924..2b654763d 100644 --- a/docs/guides/interactions/application-commands/slash-commands/05-responding-ephemerally.md +++ b/docs/guides/interactions/application-commands/slash-commands/05-responding-ephemerally.md @@ -1,3 +1,8 @@ +--- +uid: Guides.SlashCommands.Ephemeral +title: Ephemeral Responses +--- + # Responding ephemerally What is an ephemeral response? Basically, only the user who executed the command can see the result of it. In labs this is pretty simple to do. diff --git a/docs/guides/interactions/application-commands/slash-commands/06-subcommands.md b/docs/guides/interactions/application-commands/slash-commands/06-subcommands.md index 54ff03cdc..ac8c7313d 100644 --- a/docs/guides/interactions/application-commands/slash-commands/06-subcommands.md +++ b/docs/guides/interactions/application-commands/slash-commands/06-subcommands.md @@ -1,3 +1,8 @@ +--- +uid: Guides.SlashCommands.SubCommand +title: Sub Commands +--- + # Subcommands Subcommands allow you to have multiple commands available in a single command. They can be useful for representing sub options for a command. For example: A settings command. Let's first look at some limitations with subcommands set by discord. diff --git a/docs/guides/interactions/application-commands/slash-commands/07-choice-slash-command.md b/docs/guides/interactions/application-commands/slash-commands/07-choice-slash-command.md index 53cccb39e..79de5ffbc 100644 --- a/docs/guides/interactions/application-commands/slash-commands/07-choice-slash-command.md +++ b/docs/guides/interactions/application-commands/slash-commands/07-choice-slash-command.md @@ -1,3 +1,8 @@ +--- +uid: Guides.SlashCommands.Choices +title: Slash Command Choices +--- + # Slash Command Choices. With slash command options you can add choices, making the user select between some set values. Lets create a command that asks how much they like our bot! diff --git a/docs/guides/interactions/application-commands/slash-commands/08-bulk-overwrite-of-global-slash-commands.md b/docs/guides/interactions/application-commands/slash-commands/08-bulk-overwrite-of-global-slash-commands.md index 0a1aab461..e2511ab98 100644 --- a/docs/guides/interactions/application-commands/slash-commands/08-bulk-overwrite-of-global-slash-commands.md +++ b/docs/guides/interactions/application-commands/slash-commands/08-bulk-overwrite-of-global-slash-commands.md @@ -1,4 +1,10 @@ +--- +uid: Guides.SlashCommands.BulkOverwrite +title: Slash Command Bulk Overwrites +--- + If you have too many global commands then you might want to consider using the bulk overwrite function. + ```cs public async Task Client_Ready() { List applicationCommandProperties = new(); @@ -8,7 +14,7 @@ public async Task Client_Ready() { globalCommandHelp.WithName("help"); globalCommandHelp.WithDescription("Shows information about the bot."); applicationCommandProperties.Add(globalCommandHelp.Build()); - + // Slash command with name as its parameter. SlashCommandOptionBuilder slashCommandOptionBuilder = new(); slashCommandOptionBuilder.WithName("name"); @@ -16,11 +22,11 @@ public async Task Client_Ready() { slashCommandOptionBuilder.WithDescription("Add a family"); slashCommandOptionBuilder.WithRequired(true); // Only add this if you want it to be required - SlashCommandBuilder globalCommandAddFamily = new SlashCommandBuilder(); + SlashCommandBuilder globalCommandAddFamily = new SlashCommandBuilder(); globalCommandAddFamily.WithName("add-family"); globalCommandAddFamily.WithDescription("Add a family"); applicationCommandProperties.Add(globalCommandAddFamily.Build()); - + await _client.BulkOverwriteGlobalApplicationCommandsAsync(applicationCommandProperties.ToArray()); } catch (ApplicationCommandException exception) { var json = JsonConvert.SerializeObject(exception.Error, Formatting.Indented); diff --git a/docs/guides/interactions/intro.md b/docs/guides/interactions/intro.md new file mode 100644 index 000000000..62b2dfdb5 --- /dev/null +++ b/docs/guides/interactions/intro.md @@ -0,0 +1,10 @@ +--- +uid: Guides.Interactions.Intro +title: Introduction to Interactions +--- + +# Interactions + +Placeholder text does the brrr. + +Links to different sections of guides: msg comp / slash commands. diff --git a/docs/guides/toc.yml b/docs/guides/toc.yml index 62244fc94..64ed1c8cc 100644 --- a/docs/guides/toc.yml +++ b/docs/guides/toc.yml @@ -39,6 +39,20 @@ items: - name: Introduction topicUid: Guides.Interactions.Intro + - name: Creating slash commands + topicUid: Guides.SlashCommands.Creating + - name: Receiving and responding to slash commands + topicUid: Guides.SlashCommands.Receiving + - name: Slash command parameters + topicUid: Guides.SlashCommands.Parameters + - name: Ephemeral responses + topicUid: Guides.SlashCommands.Ephemeral + - name: Sub commands + topicUid: Guides.SlashCommands.SubCommand + - name: Slash command choices + topicUid: Guides.SlashCommands.Choices + - name: Slash ommands Bulk Overwrites + topicUid: Guides.SlashCommands.BulkOverwrite - name: Emoji topicUid: Guides.Emoji - name: Voice diff --git a/docs/index.md b/docs/index.md index 1d0f5aaf7..9a617344a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -3,20 +3,19 @@ uid: Root.Landing title: Home --- -# Discord.Net Documentation +# Discord.Net Labs Documentation -[![GitHub](https://img.shields.io/github/last-commit/discord-net/discord.net?style=plastic)](https://github.com/discord-net/Discord.Net) -[![NuGet](https://img.shields.io/nuget/vpre/Discord.Net.svg?maxAge=2592000?style=plastic)](https://www.nuget.org/packages/Discord.Net) -[![MyGet](https://img.shields.io/myget/discord-net/vpre/Discord.Net.svg)](https://www.myget.org/feed/Packages/discord-net) -[![Build Status](https://dev.azure.com/discord-net/Discord.Net/_apis/build/status/discord-net.Discord.Net?branchName=dev)](https://dev.azure.com/discord-net/Discord.Net/_build/latest?definitionId=1&branchName=dev) -[![Discord](https://discord.com/api/guilds/81384788765712384/widget.png)](https://discord.gg/jkrBmQR) +[![GitHub](https://img.shields.io/github/last-commit/Discord-Net-Labs/Discord.Net-Labs?style=plastic)](https://github.com/Discord-Net-Labs/Discord.Net-Labs) +[![NuGet](https://img.shields.io/nuget/vpre/Discord.Net.Labs.svg?maxAge=2592000?style=plastic)](https://www.nuget.org/packages/Discord.Net.Labs/) +[![MyGet](https://img.shields.io/myget/discord-net-labs/vpre/Discord.Net.Labs.svg)](https://www.myget.org/feed/Packages/discord-net-labs) +[![Build Status](https://dev.azure.com/Discord-Net-Labs/Discord-Net-Labs/_apis/build/status/discord-net.Discord.Net?branchName=dev)](https://dev.azure.com/Discord-Net-Labs/Discord-Net-Labs/_build/latest?definitionId=1&branchName=release%2F3.x) +[![Discord](https://discord.com/api/guilds/848176216011046962/widget.png)](https://discord.gg/dvSfUTet3K) -## What is Discord.Net? +## What is Discord.Net Labs? -Discord.Net is an asynchronous, multi-platform .NET Library used to -interface with the [Discord API](https://discord.com/). +Discord.Net Labs is an experimental fork of Discord.Net that implements the newest discord features for testing and development to eventually get merged into Discord.Net ## Where to begin?