Skip to content

Commit

Permalink
Add a note about refreshing the Discord client to see application com…
Browse files Browse the repository at this point in the history
…mands
  • Loading branch information
KubaZ2 committed Nov 15, 2024
1 parent 7a700c6 commit 3740e2f
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions Documentation/guides/services/application-commands/introduction.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
---
---
uid: application-commands
---

# Introduction

> [!IMPORTANT]
> Please note that names of:
> - slash commands
> - sub slash commands
> - slash command parameters
>
> **must** be lowercase.
## [.NET Generic Host](#tab/generic-host)

Adding application commands with the .NET Generic Host is very easy. Use @NetCord.Hosting.Services.ApplicationCommands.ApplicationCommandServiceServiceCollectionExtensions.AddApplicationCommands``2(Microsoft.Extensions.DependencyInjection.IServiceCollection) to add an application command service to your host builder. Then, use @NetCord.Hosting.Services.ApplicationCommands.ApplicationCommandServiceHostExtensions.AddSlashCommand*, @NetCord.Hosting.Services.ApplicationCommands.ApplicationCommandServiceHostExtensions.AddUserCommand* or @NetCord.Hosting.Services.ApplicationCommands.ApplicationCommandServiceHostExtensions.AddMessageCommand* to add an application command using the minimal APIs way and/or use @NetCord.Hosting.Services.ServicesHostExtensions.AddModules(Microsoft.Extensions.Hosting.IHost,System.Reflection.Assembly) to add modules from an assembly. You also need to use @NetCord.Hosting.Gateway.GatewayEventHandlerHostExtensions.UseGatewayEventHandlers(Microsoft.Extensions.Hosting.IHost) to bind the service event handlers.
Expand All @@ -38,6 +30,17 @@ Now, we should send the commands to Discord, to make them usable. Add the follow

***

> [!NOTE]
> If you don't see the commands in Discord, try refreshing the Discord client using `Ctrl + R` on PC or `⌘ + R` on Mac.
> [!IMPORTANT]
> Please note that names of:
> - slash commands
> - sub slash commands
> - slash command parameters
>
> **must** be lowercase.
### Example Modules

Here you can see example modules for each type of application command.
Expand Down

0 comments on commit 3740e2f

Please sign in to comment.