#slash commands and commands in general

41 messages · Page 1 of 1 (latest)

fervent acorn
#

i need help with my code

smoky dock
#

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

fervent acorn
#

my discord.js version is 14.7.1 and my node is 18.12.1

my issue is: my commands is not working in my discord server and i dont know why, already online in the discord server and not working at all.

stoic jasperBOT
#

To share long code snippets use a service like gist, sourcebin, starbin, or similar instead of posting them as large code blocks.

fervent acorn
warped prism
#

you are missing the client.login(TOKEN) bit or did you redact it?

warped prism
#

the cliient.on(message) bit should be outside of the client.on(ready) block

#

if it is inside it will only listen for the split second when the client is ready

fathom veldt
fervent acorn
fervent acorn
warped prism
#

try: const client = new Discord.Client({ intents: [GatewayIntentBits.Guilds] });

#

btw i see you are at the beginning: consider using slash commands

warped prism
fathom veldt
fervent acorn
#

still not working :/

fathom veldt
#

type Discord.GatewayIntentBits.Guilds instead

warped prism
#

add const { GatewayIntentBits } = Discord; at the beginning or use const client = new Discord.Client({ intents: [Discord.GatewayIntentBits.Guilds] });

fervent acorn
warped prism
warped prism
warped prism
fervent acorn
#

oh ok

fathom veldt
#

as he said, I recommend you to use slash commands

warped prism
#

sorry for the ping btw

fervent acorn
#

the terminal is ok, but it is not recognizing the command yet

#

in "!" or "/"

warped prism
#

console log your command variable

#

slash commands require a different setup, please refer to the guide first

tight topaz
#

And you are missing GuildMessages and MessageContent intent to use prefix commands

#

At this point just check djs guide and learn how slashcommands work

warped prism
warped prism