register commands for multiple servers

i got the code for my command register file from the docs. there you need to input a guild id, but what if you can add my bot to multiple discord servers then i cant just all copy in ids right? how would i do that? is there a way to like globaly register commands?
18 Replies
d.js toolkit
d.js toolkit6mo ago
- 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 OP
treble/luna
treble/luna6mo ago
use global commands
d.js docs
d.js docs6mo ago
:guide: Creating Your Bot: Registering slash commands - Command registration > Global commands read more
consttDe
consttDeOP6mo ago
thx ill look at it
Inky
Inky6mo ago
Just remember to remove the guild commands you deployed
consttDe
consttDeOP6mo ago
remove?
Inky
Inky6mo ago
Yes
consttDe
consttDeOP6mo ago
how would i remove the,
treble/luna
treble/luna6mo ago
deploy an empty array
consttDe
consttDeOP6mo ago
ah okay
consttDe
consttDeOP6mo ago
is this right?
const data = await rest.put(
Routes.applicationGuildCommands(process.env.CLIENT_ID),
{ body: commands }
);
const data = await rest.put(
Routes.applicationGuildCommands(process.env.CLIENT_ID),
{ body: commands }
);
No description
treble/luna
treble/luna6mo ago
no .
consttDe
consttDeOP6mo ago
did it
treble/luna
treble/luna6mo ago
Not in the code you showed
consttDe
consttDeOP6mo ago
yea ik but i changed it now to applicationCommands but on my guild i dont see the command (i registerd it too)
treble/luna
treble/luna6mo ago
did you refresh your discord client
consttDe
consttDeOP6mo ago
Oh thats for sure it u mean like CTRL+R
treble/luna
treble/luna6mo ago
yes

Did you find this page helpful?