Browse Source

Update docfx references

pull/1923/head
quin lynch 3 years ago
parent
commit
e8faa00774
10 changed files with 80 additions and 15 deletions
  1. +11
    -2
      docs/guides/interactions/application-commands/slash-commands/02-creating-slash-commands.md
  2. +8
    -1
      docs/guides/interactions/application-commands/slash-commands/03-responding-to-slash-commands.md
  3. +5
    -0
      docs/guides/interactions/application-commands/slash-commands/04-parameters.md
  4. +5
    -0
      docs/guides/interactions/application-commands/slash-commands/05-responding-ephemerally.md
  5. +5
    -0
      docs/guides/interactions/application-commands/slash-commands/06-subcommands.md
  6. +5
    -0
      docs/guides/interactions/application-commands/slash-commands/07-choice-slash-command.md
  7. +9
    -3
      docs/guides/interactions/application-commands/slash-commands/08-bulk-overwrite-of-global-slash-commands.md
  8. +10
    -0
      docs/guides/interactions/intro.md
  9. +14
    -0
      docs/guides/toc.yml
  10. +8
    -9
      docs/index.md

+ 11
- 2
docs/guides/interactions/application-commands/slash-commands/02-creating-slash-commands.md View File

@@ -1,3 +1,8 @@
---
uid: Guides.SlashCommands.Creating
title: Creating Slash Commands
---

# Creating your first slash commands. # Creating your first slash commands.


There are two kinds of Slash Commands: global commands and guild 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. | | AddOption | Function | Adds an option to the current slash command. |
| Build | Function | Builds the builder into a `SlashCommandCreationProperties` class used to make slash commands | | 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. 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.

+ 8
- 1
docs/guides/interactions/application-commands/slash-commands/03-responding-to-slash-commands.md View File

@@ -1,3 +1,8 @@
---
uid: Guides.SlashCommands.Receiving
title: Receiving and Responding to Slash Commands
---

# Responding to interactions. # 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. 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 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. This seems to be working! Next, we will look at parameters for slash commands.

+ 5
- 0
docs/guides/interactions/application-commands/slash-commands/04-parameters.md View File

@@ -1,3 +1,8 @@
---
uid: Guides.SlashCommands.Parameters
title: Slash Command Parameters
---

# 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. Slash commands can have a bunch of parameters, each their own type. Let's first go over the types of parameters we can have.


+ 5
- 0
docs/guides/interactions/application-commands/slash-commands/05-responding-ephemerally.md View File

@@ -1,3 +1,8 @@
---
uid: Guides.SlashCommands.Ephemeral
title: Ephemeral Responses
---

# Responding ephemerally # 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. 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.


+ 5
- 0
docs/guides/interactions/application-commands/slash-commands/06-subcommands.md View File

@@ -1,3 +1,8 @@
---
uid: Guides.SlashCommands.SubCommand
title: Sub Commands
---

# Subcommands # 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. 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.


+ 5
- 0
docs/guides/interactions/application-commands/slash-commands/07-choice-slash-command.md View File

@@ -1,3 +1,8 @@
---
uid: Guides.SlashCommands.Choices
title: Slash Command Choices
---

# 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! 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!


+ 9
- 3
docs/guides/interactions/application-commands/slash-commands/08-bulk-overwrite-of-global-slash-commands.md View File

@@ -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. If you have too many global commands then you might want to consider using the bulk overwrite function.

```cs ```cs
public async Task Client_Ready() { public async Task Client_Ready() {
List<ApplicationCommandProperties> applicationCommandProperties = new(); List<ApplicationCommandProperties> applicationCommandProperties = new();
@@ -8,7 +14,7 @@ public async Task Client_Ready() {
globalCommandHelp.WithName("help"); globalCommandHelp.WithName("help");
globalCommandHelp.WithDescription("Shows information about the bot."); globalCommandHelp.WithDescription("Shows information about the bot.");
applicationCommandProperties.Add(globalCommandHelp.Build()); applicationCommandProperties.Add(globalCommandHelp.Build());
// Slash command with name as its parameter. // Slash command with name as its parameter.
SlashCommandOptionBuilder slashCommandOptionBuilder = new(); SlashCommandOptionBuilder slashCommandOptionBuilder = new();
slashCommandOptionBuilder.WithName("name"); slashCommandOptionBuilder.WithName("name");
@@ -16,11 +22,11 @@ public async Task Client_Ready() {
slashCommandOptionBuilder.WithDescription("Add a family"); slashCommandOptionBuilder.WithDescription("Add a family");
slashCommandOptionBuilder.WithRequired(true); // Only add this if you want it to be required 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.WithName("add-family");
globalCommandAddFamily.WithDescription("Add a family"); globalCommandAddFamily.WithDescription("Add a family");
applicationCommandProperties.Add(globalCommandAddFamily.Build()); applicationCommandProperties.Add(globalCommandAddFamily.Build());
await _client.BulkOverwriteGlobalApplicationCommandsAsync(applicationCommandProperties.ToArray()); await _client.BulkOverwriteGlobalApplicationCommandsAsync(applicationCommandProperties.ToArray());
} catch (ApplicationCommandException exception) { } catch (ApplicationCommandException exception) {
var json = JsonConvert.SerializeObject(exception.Error, Formatting.Indented); var json = JsonConvert.SerializeObject(exception.Error, Formatting.Indented);


+ 10
- 0
docs/guides/interactions/intro.md View File

@@ -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.

+ 14
- 0
docs/guides/toc.yml View File

@@ -39,6 +39,20 @@
items: items:
- name: Introduction - name: Introduction
topicUid: Guides.Interactions.Intro 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 - name: Emoji
topicUid: Guides.Emoji topicUid: Guides.Emoji
- name: Voice - name: Voice


+ 8
- 9
docs/index.md View File

@@ -3,20 +3,19 @@ uid: Root.Landing
title: Home title: Home
--- ---


# Discord.Net Documentation
# Discord.Net Labs Documentation


<div class="big-logo logo-switcher"></div> <div class="big-logo logo-switcher"></div>


[![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? ## Where to begin?




Loading…
Cancel
Save