Log received DM #9065
-
Hi, I'm trying to (at first) log a message that a user send to my bot but I didn't make success... Could someone help me please ? (I'm also French so, sorry for my bad English). I'm also running on the 14.7.1 version of discord. Here is some part of my code: const client = new Client({ client.commands = new Collection(); for (const file of commandFiles) { client.on("message", async message => { |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
The - client.on("message", async message => {
+ client.on("messageCreate", async message => { Additionally, you might want to ignore messages that aren't from DMs. For that, you can use |
Beta Was this translation helpful? Give feedback.
The
message
event was renamed tomessageCreate
on v14Additionally, you might want to ignore messages that aren't from DMs. For that, you can use
message.channel.isDMBased()
, which returns a boolean