#New Discord Commands Won't Show Up

1 messages · Page 1 of 1 (latest)

green shadow
#

I'm looking to test out new Slash commands for our server, but when running locally, I don't see the new commands being added to my test Discord server.

I have confirmed that the locally running code is being triggered by the commands that already existed, but the new command just isn't being registered. Any ideas?

pine oasis
green shadow
#

Yeah I checked that by re-adding it to the server. Any specific way to confirm that you know of,

pine oasis
#

Hmm, not offhand. Have you tried doing a manual redeploy?

#

Back when I was testing the deepgram bot for the hackathon, I had to drop all commands and redeploy regularly

green shadow
#

Did you have a specific redeploy script? I think I might have to do that but I didn't have to before

pine oasis
#

https://discordjs.guide/slash-commands/deleting-commands.html#deleting-all-commands so used this to drop all commands

then followed the deploy instruction to redeploy them all
https://discordjs.guide/creating-your-bot/command-deployment.html#command-registration

since slash commands are almost more like standalone serverless functions, than part of the actual bot at this point
It's what allows them to still populate and handle parsed input even if the bot is offline and gets woken up by the command

green shadow
#

Yeah that makes sense. So I have some work to do to update the code for that

mighty kettle
#

Did they ever show up like an hour later? I know previously if you've deployed guild specific commands they will usually be instant, but if its global they could take up to an hour to appear. (it could be the other way around). Not sure if they've gotten to a point where both is now instant.

Some cases I've noticed just simply pressing ctrl+r to reload the discord application works too.

green shadow
#

I haven't actually gotten them to show up in development yet at all. So I don't know unforutnately 😦

mighty kettle
#

djs? When you get a sec can you upload the portion of code where you are deploying the commands? or a link to it if its online.

green shadow
#

Well, I'm not actually running a deploy command jsut yet. I didn't have to do that, but seems like now I do? So even to test them I need to run an actual deploy command?

pine oasis
#

Yeah, believe so

mighty kettle
#

Yes, you need to deploy the comands everytime you add one. Discord will just append any changes and refresh any old commands. Annoying, but i usually write it as a module in a separate file and then call it in my index file. So everytime i start the bot it deploys any command changes.