Skip to content

Instantly share code, notes, and snippets.

View solundev's full-sized avatar
🌷
Looking for internal jobs on discord.com

𓆩 ∱.Stefzy 𓆪 solundev

🌷
Looking for internal jobs on discord.com
  • Capivari, São Paulo - Brasil
  • 08:11 (UTC -03:00)
View GitHub Profile
@solundev
solundev / discordjs-slash-commands.md
Created April 25, 2021 06:03 — forked from advaith1/discordjs-slash-commands.md
Slash Commands in Discord.js

Slash Commands in Discord.js

These are some simple examples for using Slash Commands in discord.js.
discord.js doesn't have full support for slash commands yet (there's a pr) but you can still use the underlying api and websocket to use them.
Note that discord.js doesn't officially support using client.api, this is basically just a workaround until they fully release support. Do not ask for help with client.api in the discord.js server.

Please read Discord's Slash Command docs since they have actual docs and details for slash commands; the code examples below are just how you can implement it using discord.js.

Note that slash commands won't show in a server unless that server has authorized it with the applications.commands oauth2 scope (not just the bot scope).