You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

01-getting-started.md 1.7 KiB

1234567891011121314151617181920212223
  1. # Getting started with slash commands.
  2. Welcome! This guide will show you how to use slash commands. If you have extra questions that aren't covered here you can come to our [Discord](https://discord.com/invite/dvSfUTet3K) server and ask around there.
  3. ## What is a slash command?
  4. Slash Commands _(synonymous with application commands)_ are made up of a name, description, and a block of options, which you can think of like arguments to a function. The name and description help users find your command among many others, and the options validate user input as they fill out your command.
  5. Your global commands are available in every guild that adds your application. You can also make commands for a specific guild; they're only available in that guild.
  6. An Interaction is the message that your application receives when a user uses a command. It includes the values that the user submitted, as well as some metadata about this particular instance of the command being used: the guild_id, channel_id, member and other fields. You can find all the values in our data models.
  7. ## Authorizing your bot for slash commands
  8. There is a new special OAuth2 scope for applications called `applications.commands`. In order to make Slash Commands work within a guild, the guild must authorize your application with the `applications.commands` scope. The bot scope is not enough.
  9. Head over to your discord applications OAuth2 screen and make sure to select the `application.commands` scope.
  10. ![OAuth2 scoping](images/oauth.png)
  11. From there you can then use the link to add your bot to a server.
  12. **Note**: In order for users in your guild to use your slash commands, they need to have the "Use Slash Command" permission on the guild.