command handler not registering commands

. I'll upload sourcebins one moment
30 Replies
d.js toolkit
d.js toolkit2y ago
• 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.
NullIntended
NullIntendedOP2y ago
SourceBin
index
Instantly share your code with the world.
SourceBin
register
Instantly share your code with the world.
SourceBin
handler
Instantly share your code with the world.
NullIntended
NullIntendedOP2y ago
File layout
NullIntended
NullIntendedOP2y ago
So no issues other than it says the command loads, but it doesn't register within discord
treble/luna
treble/luna2y ago
Do you run the deploy file itself and why do you have 3 interactionCreate listeners
NullIntended
NullIntendedOP2y ago
Buttons, commands, menus It's extremely rough draft on that I just let copilot make them lmfso The register command does run as that file is the one that logs the commands loaded
NullIntended
NullIntendedOP2y ago
It is logging the command as well
treble/luna
treble/luna2y ago
you can also just create one listener and that is your index file you run You never run your deploy file
NullIntended
NullIntendedOP2y ago
Yeah I will compile the listeners into one once I get the commands to run Oh my god I remember what I did
NullIntended
NullIntendedOP2y ago
NullIntended
NullIntendedOP2y ago
It does run. It's inside my package.json to run
treble/luna
treble/luna2y ago
but you run node . node . =/= npm run just do node register.js
NullIntended
NullIntendedOP2y ago
Changed that and still nothing
treble/luna
treble/luna2y ago
what did you change? You shouldn't change anything Just run what i said
NullIntended
NullIntendedOP2y ago
The script section I changed it to node register.js
treble/luna
treble/luna2y ago
... you never run that script in the first place as i told you before Just run node register.js directly
NullIntended
NullIntendedOP2y ago
Ok, so I ran that directory and the command loaded, printed it and showed it but bot immediately shut down
treble/luna
treble/luna2y ago
because the register command just registers your commands nothing more
NullIntended
NullIntendedOP2y ago
Oh!!!!!!!!!! This just clicked So basically anytime I add a command, do node register.js
treble/luna
treble/luna2y ago
yes
NullIntended
NullIntendedOP2y ago
Any other time just do node .
treble/luna
treble/luna2y ago
yep
NullIntended
NullIntendedOP2y ago
Does discord unregister after a set amount of time?
treble/luna
treble/luna2y ago
no
NullIntended
NullIntendedOP2y ago
Perfect Ty So add and remove, do node register
treble/luna
treble/luna2y ago
remove would be passing in an empty array as body and then re-registering your commands
NullIntended
NullIntendedOP2y ago
Perfect. I can adjust commands tho just fine? Or every adjustment I have to re register Auto correct literally fails me
treble/luna
treble/luna2y ago
whenever you add / edit a command you need to re-register yes
NullIntended
NullIntendedOP2y ago
Ah crap Ok
treble/luna
treble/luna2y ago
you should be able to do that while your bot is running
Want results from more Discord servers?
Add your server