how to add a listener so if someone sent message in the server, the bot does action ?
i want to make console.log that there is a user sent message .. how to do that ? it's like a listener ig .. i used this but it didn't work :
19 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 staffits messageCreate
you need the Guilds, GuildMessages, and MessageContent intent
?
yes
it still doesn't work
and did you add the intents i told you
when i send message such as " test " .. there is no action
i was going to ask you where are these things in the docs
sorry iam a beginner :/
well
you're better of starting with v14
it has all the new features
@polarwolvinny ❄ 🌈
is that correct ?
sure
why do you have 2 clients
you only need 1
ok
there are two clients bec i use one for other things, and one for the messages
thats not how it works
you only need one client
you can do everything with one
hm ok
do you see to use the first client or the second one ?
i mean the part of " new Client " and " new Discord.Client "
either destructure or dont
but not both
and not twice
ok
@polarwolvinny ❄ 🌈 now iam using one client
and the messageCreate code
is everything fine now or something left ?
you dont have the GuildMessages intent
oh yeah wait
@polarwolvinny ❄ 🌈 it works now
thank you very much