#My Slash Commands Are Registering 2 Times And Same Command Exist 2 Times

26 messages · Page 1 of 1 (latest)

willow tapir
#

My Slash Same Command Exist 2 Times.

delicate fractalBOT
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

marble musk
#

Pls send your code

willow tapir
#

Handler Code???

elder wind
#

once on the guild, once globally

willow tapir
#

Can I Delete Golbal Commands

#

I Dont Want It

#

I Disabled It For Now

elder wind
#

sure, redeploy to global with the list you want

willow tapir
#

Bust How TO Delte

elder wind
#

if none - empty list

willow tapir
elder wind
#

don't know what more to say

#

you send a list of commands you want to be there

#

if you want something to not be on that list, don't send it when you deploy global commands

ocean jungle
willow tapir
#

kk

thorny tendon
#

Something I went through myself

#

What I did to resolve this is:
Whenever the bot is launched

  • delete all guild command (test environment) or delete all global command (production environment)
  • deploy all command either on guild or global depending on the environment
#

This way you don't end up with duplicates AND you remove old / deprecated / dropped / removed commands so that no garbage is kept along the way

#

Be careful, to my knowledge, Discord is limiting you from creating and deleting global commands, iirc it's 200 per day

elder wind
#

that's such a bad suggestion... you should deploy commands when you know you changed arguments, not every time the bot restarts

#

additionally you even suggest a two-operation flow that can be done in one, you don't need to delete all and then deploy, you can do that by just deploying the ones you want to keep/the new status

#

depending on the amount of guilds that suggestion becomes even worse, of course

wraith dove
#

Is there a way to check whether a command has already been registered in a server?

#

I've been trying to find this via google and via the discord.js documentation, but I haven't had any luck.