I cannot even see the commands registered

So my files look like this: index.js https://sourceb.in/3gU3xsnpt5 src\ deploy-commands.js https://sourceb.in/dfM4gUHKbJ deploy-moderation.js https://sourceb.in/TKkZZGiARM commands\ ping.js https://sourceb.in/E8XdksVfpm moderation\ mute.js https://sourceb.in/JMa9SSBxxW If you'd like to know, I am trying to get the guildId. So for eg: If dyno joins a server, it doesnt manually gets the guildid and the owner writes it in the code, but the bot is coded to get the guildid and that was what I was trying to recreate.
22 Replies
d.js toolkit
d.js toolkit2w ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
treble/luna
treble/luna2w ago
why do you have 2 separate rest calls one will overwrite the other use 1 call and dont call it everytime your bot starts
BMmarci1234
BMmarci1234OP2w ago
ok let me try
treble/luna
treble/luna2w ago
actually are you running those files at all as they do seem to be separate already
BMmarci1234
BMmarci1234OP2w ago
no i dont
treble/luna
treble/luna2w ago
yeah those wont call themselves but still
BMmarci1234
BMmarci1234OP2w ago
Should I execute it to register the commands with Discord?
treble/luna
treble/luna2w ago
one will overwrite the other yes
BMmarci1234
BMmarci1234OP2w ago
Okay lets try
treble/luna
treble/luna2w ago
but move it in one file
BMmarci1234
BMmarci1234OP2w ago
The deploy commands and the deploy moderation?
treble/luna
treble/luna2w ago
yes
BMmarci1234
BMmarci1234OP2w ago
Okay.
treble/luna
treble/luna2w ago
and if you want your commands to be available in all servers, use global commands instead of guild commands
BMmarci1234
BMmarci1234OP2w ago
Okay I tried but it didnt work. So could you help me what i did wrong: index.js https://sourceb.in/jiTTem3RiE src\ deploy.js https://sourceb.in/dqsGYza72M commands\ ping.js https://sourceb.in/E8XdksVfpm moderation\ mute.js https://sourceb.in/JMa9SSBxxW I mean I doesnt see it registered
treble/luna
treble/luna2w ago
where did you get that code fromn first of all thats exactly what i told you not to do i dont see why you edited it in the first place, it worked, you just need to merge your commands into a singnle body you didnt ask ai, did you because why do you have a config.json if you use .env
BMmarci1234
BMmarci1234OP2w ago
I have .env for token and config.json for client id and later I will put more things.
treble/luna
treble/luna2w ago
why
BMmarci1234
BMmarci1234OP2w ago
Idk
treble/luna
treble/luna2w ago
Use one of both and dont ask ai
BMmarci1234
BMmarci1234OP2w ago
what do you recommend
treble/luna
treble/luna2w ago
whichever you prefer

Did you find this page helpful?