How do I get the bot to respond to DM messages that are written to it from the user?
I still can't find an example where there is an event that would trigger whenever a user writes a message to a bot in the DM
16 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!for a chat on the server, it is clear that there is a message Create, but it is not called if the user writes a message to the DM
The bot has shared all the rights in the console and also here is its config:
by the way, he does not react to the message at all, as I understand it, it was cut out of version 14?
this does not work either on the server in the chat or in the DM chat with the bot
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
this only works on the server in chats
and where to get them?
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
so what's next? will the message Create or message event work by itself?
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
ok I replaced what's next?
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
message event don't work
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
should I replace it with message Create?
ok
don't working:
console log:
when sending a message to the DM, message does not appear in the console! the token of the bot in the studio is here, I removed it so that I didn't have to restart it later
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
and how to do it, what to write there?
simply
?
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
is there any other library needed here?
or should I add something to the constant?
before that when it was like this:
there was no mistake
but it didn't lead to anything
working BIG THANKS!