#command thing

48 messages · Page 1 of 1 (latest)

hallow roostBOT
#

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

sharp wind
#

why dont the slash commands work?

remote walrus
#

You are missing the required intents

#

GuildMessages and MessageContent

sharp wind
#

in what way?

#

saying 'it doesnt work' isn't helpful

#

cycling ?

remote walrus
#

Do you even have proper slash command files

sharp wind
#

where

#

i dont see any command

#

that's not a slash command

#

do you even respond to the interaction in your command?

#

?

#

you probably don't respond to the interaction (the slash command response) in your command file

fallow rootBOT
#

Responding to interactions:
#reply immediately respond with a message
#update immediately update the original message (buttons, select menus)
#showModal immediately show a modal (cannot be deferred)
#deferReply/Update respond later (up to 15 minutes)
#followUp post an additional message

The initial response has to happen within 3s of receiving the interaction!

remote walrus
#

Exactly

sharp wind
#

the guide specifically covers responding to a simple ping command

#

ok so thats exactly why your slash command isn't working

#

because you never responded to the interaction

#

make sure you add those missing intents as shown above and adding that interaction.reply to your slash command

#

you dont have client or user defined

#

you can use interaction.user for the user and interaction.client for the client

#

and also, you dont even need to use that var since the value isn't changed

#

so just use const

#

shouldn't use var at all

#

let is preferred highly over var

#

its not defined in the code you sent so im not sure how that's relevant

sharp wind
#

for message, message.author (which is the same as interaction.user) and message.client

#

no worries

#

correct

#

you still need to access client.user

#

yes

sharp wind
#

please stop pinging me

#

maybe you shouldn't set your client's username every 5 seconds

#

you're probably rate limited

remote walrus
#

Yeah cuz the ratelimit is somewhere around twice in an hour or something like that

sharp wind
remote walrus
#

Usernames arent nicknames

#

guild.members.me.setNickname()

#

Yea

#

interaction.guild is the guild

#

Is that what I said

#

Spoiler: || no ||

remote walrus
#

I already told you

#

That refers to the clients guildmember object