Browse Source

Amend creating slash command guide (#269)

* Adding BotHTTPInteraction user flag

* Added comments explaining the Global command create stipulations.
pull/1923/head
KeylAmi GitHub 3 years ago
parent
commit
ef4aa62363
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      docs/guides/interactions/application-commands/slash-commands/02-creating-slash-commands.md

+ 3
- 1
docs/guides/interactions/application-commands/slash-commands/02-creating-slash-commands.md View File

@@ -79,6 +79,8 @@ public async Task Client_Ready()


// With global commands we dont need the guild. // With global commands we dont need the guild.
await client.CreateGlobalApplicationCommandAsync(globalCommand.Build()); await client.CreateGlobalApplicationCommandAsync(globalCommand.Build());
// Using the ready event is a simple implementation for the sake of the example. Suitable for testing and development.
// For a production bot, it is recommended to only run the CreateGlobalApplicationCommandAsync() once for each command.
} }
catch(ApplicationCommandException exception) catch(ApplicationCommandException exception)
{ {
@@ -93,4 +95,4 @@ public async Task Client_Ready()
``` ```


> [!NOTE] > [!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.
> 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. The global commands take up to an hour to register every time the CreateGlobalApplicationCommandAsync() is called for a given command.

Loading…
Cancel
Save