how to check if a user sent a message in discord js
if(message.author.id === client.user.id) return;
how to check if a user sent a message in discord js
if(message.author.id === client.user.id) return;
how to read if a person has send a message on discord.js
client.on('message', message => {
// this function can check whether the content of the message you pass is the same as this message
let filter = msg => {
return msg.content.toLowerCase() == message.content.toLowerCase() && // check if the content is the same (sort of)
msg.author == message.author; // check if the author is the same
}
message.channel.awaitMessages(filter, {
maxMatches: 1, // you only need that to happen once
time: 5 * 1000 // time is in milliseconds
}).then(collected => {
// this function will be called when a message matches you filter
}).catch(console.error);
});
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us