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
- 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 OPwhy do you have 2 separate rest calls
one will overwrite the other
use 1 call
and dont call it everytime your bot starts
ok
let me try
actually
are you running those files at all
as they do seem to be separate already
no i dont
yeah those wont call themselves
but still
Should I execute it to register the commands with Discord?
one will overwrite the other
yes
Okay lets try
but move it in one file
The deploy commands and the deploy moderation?
yes
Okay.
and if you want your commands to be available in all servers, use global commands instead of guild commands
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
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
I have .env for token and config.json for client id and later I will put more things.
why
Idk
Use one of both
and dont ask ai
what do you recommend
whichever you prefer