command handler not registering commands

. I'll upload sourcebins one moment
30 Replies
d.js toolkit
d.js toolkit12mo 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
NullIntended12mo 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
NullIntended12mo ago
File layout
NullIntended
NullIntended12mo ago
So no issues other than it says the command loads, but it doesn't register within discord
treble/luna
treble/luna12mo ago
Do you run the deploy file itself and why do you have 3 interactionCreate listeners
NullIntended
NullIntended12mo 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
NullIntended12mo ago
It is logging the command as well
treble/luna
treble/luna12mo ago
you can also just create one listener and that is your index file you run You never run your deploy file
NullIntended
NullIntended12mo 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
NullIntended12mo ago
NullIntended
NullIntended12mo ago
It does run. It's inside my package.json to run
treble/luna
treble/luna12mo ago
but you run node . node . =/= npm run just do node register.js
NullIntended
NullIntended12mo ago
Changed that and still nothing
treble/luna
treble/luna12mo ago
what did you change? You shouldn't change anything Just run what i said
NullIntended
NullIntended12mo ago
The script section I changed it to node register.js
treble/luna
treble/luna12mo ago
... you never run that script in the first place as i told you before Just run node register.js directly
NullIntended
NullIntended12mo ago
Ok, so I ran that directory and the command loaded, printed it and showed it but bot immediately shut down
treble/luna
treble/luna12mo ago
because the register command just registers your commands nothing more
NullIntended
NullIntended12mo ago
Oh!!!!!!!!!! This just clicked So basically anytime I add a command, do node register.js
treble/luna
treble/luna12mo ago
yes
NullIntended
NullIntended12mo ago
Any other time just do node .
treble/luna
treble/luna12mo ago
yep
NullIntended
NullIntended12mo ago
Does discord unregister after a set amount of time?
treble/luna
treble/luna12mo ago
no
NullIntended
NullIntended12mo ago
Perfect Ty So add and remove, do node register
treble/luna
treble/luna12mo ago
remove would be passing in an empty array as body and then re-registering your commands
NullIntended
NullIntended12mo 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/luna12mo ago
whenever you add / edit a command you need to re-register yes
NullIntended
NullIntended12mo ago
Ah crap Ok
treble/luna
treble/luna12mo ago
you should be able to do that while your bot is running