Slash commands not being created
Sorry I know this has been posted multiple times before and it must be getting old by now, but I read many posts and none of the answers I found worked for me.
I am using the latest version of D.JS and Node. I have followed the tutorial to create a bot, but the slash commands simply don't show up at all. I tried restarting my Discord client several times, restarting the bot, removing the app, adding it back, etc. it just won't do anything. I am not sure what am I missing. When I run the
deploy-commands.js
file it says it worked successfully.
I am, however, using a .env
file, whereas the tutorial uses a .json
file. But still I don't see how this changes anything. Let me know if you want any specific code or anything. Thanks for reading! Sorry again for the inconvenience.5 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
- ✅
Marked as resolved by OPHere it is!
Nope. Already checked the integrations tab too
It just doesn't appear
Yes and it's online. I also disconnected and waited for it to come offline before reloading and still nothing
I did invite it with permissions for
bot
and applications.commands
Yeah
I did and it's correct, unless it has to be written in a different way. I tried both just a numeral and as a ""
string in the .env
file
It outputs fine
Sure, one moment
Interesting
I am not sure if this matters but guildid is null
Oh that must be it!
I got very confused with that whole thingIf you have duplicate commands on your server, you registered both global and guild commands.
You can remove the duplicates by resetting either the global or guild commands
- Resetting global commands:
rest.put(Routes.applicationCommands(clientId), { body: [] })
- Resetting guild commands: rest.put(Routes.applicationGuildCommands(clientId, guildId), { body: [] })
That worked!
Thanks so much! Sorry for the inconvenience