Rebuild Bot Guide ID
So, at the moment my config consists of
"guildId": "xxxxxxxxxxxxxxxx",
which is the guideID. I want to basically remove this so anyone can invite the bot into there own discord server and put the bot into there discord. Only problem being is, I have to manually do node deploy.js to build the commands for them to show up in the discord, is there anyone who would be happy to help remake this so anyone can invite the bot to there own servers etc?13 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!Deploy the commands globally instead of guild based, that way it'll be available to anyone who invites the bot
So, I'm guessing I just do it like this
You just removed the guild id there, route is still the same, follow the guide i linked
It should be
Routes.applicationCommands(clientId)
for global commands
Also you may need to reset your guild commands (in every guild where you registered it) if you don't want it to be duplicated (as both guild commands and global commands are considered different)If 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: [] })
Okay, so that's done, is there a way to see what guilds your discord bot has been added to?
:property: Client#guilds
All of the guilds the client is currently handling, mapped by their ids - as long as sharding isn't being used, this will be every guild the bot is a member of
<Client>.guilds.cache will return a collection of all the guilds your bot is in
Assuming you have guilds intent (which you should for discordjs to work properly)
I have indeed
So, I get this error, but works perfect if I do it on my own machine and not the linux
The code you sent does not match the error, according to the error you missed
,
sperator before ephemeral