#command handler not registering commands

50 messages · Page 1 of 1 (latest)

unkempt pivot
#

. I'll upload sourcebins one moment

clever pierBOT
#

• 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.

unkempt pivot
#

File layout

#

So no issues other than it says the command loads, but it doesn't register within discord

compact lintel
#

Do you run the deploy file itself

#

and why do you have 3 interactionCreate listeners

unkempt pivot
#

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

#

It is logging the command as well

compact lintel
#

you can also just create one listener

#

and that is your index file you run

#

You never run your deploy file

unkempt pivot
#

Yeah I will compile the listeners into one once I get the commands to run

#

Oh my god

#

I remember what I did

#

It does run. It's inside my package.json to run

compact lintel
#

but you run node .

#

node . =/= npm run

#

just do node register.js

unkempt pivot
#

Changed that and still nothing

compact lintel
#

what did you change?

#

You shouldn't change anything

#

Just run what i said

unkempt pivot
#

The script section

#

I changed it to node register.js

compact lintel
#

...

#

you never run that script in the first place as i told you before

#

Just run node register.js directly

unkempt pivot
#

Ok, so I ran that directory and the command loaded, printed it and showed it but bot immediately shut down

compact lintel
#

because the register command just registers your commands

#

nothing more

unkempt pivot
#

Oh!!!!!!!!!!

#

This just clicked

#

So basically anytime I add a command, do node register.js

compact lintel
#

yes

unkempt pivot
#

Any other time just do node .

compact lintel
#

yep

unkempt pivot
#

Does discord unregister after a set amount of time?

compact lintel
#

no

unkempt pivot
#

Perfect Ty

#

So add and remove, do node register

compact lintel
#

remove would be passing in an empty array as body and then re-registering your commands

unkempt pivot
#

Perfect. I can adjust commands tho just fine? Or every adjustment I have to re register

#

Auto correct literally fails me

compact lintel
#

whenever you add / edit a command you need to re-register yes

unkempt pivot
#

Ah crap

#

Ok