Refactor mention check with more appropriate method
This commit is contained in:
parent
d38dc81fb3
commit
fc4452bf7c
4
index.js
4
index.js
@ -186,11 +186,9 @@ function generate_messages(text) {
|
||||
}
|
||||
|
||||
function userInMentions(user, message) {
|
||||
let matchingUser = message.mentions.users.find(
|
||||
return message.mentions.users.some(
|
||||
u => u === user
|
||||
);
|
||||
|
||||
return matchingUser !== undefined;
|
||||
}
|
||||
|
||||
client.on('messageCreate', (message) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user