Don't try to check roles if message came from a bot (or webhook, they both return true for that flag)
This commit is contained in:
parent
ab913abc03
commit
dd9548cf18
17
main.ts
17
main.ts
@ -127,15 +127,16 @@ function checkMessage(message) {
|
||||
var rebuildMessageArray = [];
|
||||
//console.log("Corrected Message: " + correctedMessage);
|
||||
if (!message.author.bot) {
|
||||
if (abbreviationKey.target_phrases[matchMessageArray[i]] !== undefined) {
|
||||
console.log("Has role? " + message.member.roles.cache.some(role => role.name == "Exempt from NoMoreAcronyms"));
|
||||
if (message.member.roles.cache.some(role => role.name == "Exempt from NoMoreAcronyms")) {
|
||||
message.react('🇵');
|
||||
message.react('🇴');
|
||||
message.react('🇬');
|
||||
return;
|
||||
}
|
||||
if (abbreviationKey.target_phrases[matchMessageArray[i]] !== undefined) {
|
||||
console.log("Has role? " + message.member.roles.cache.some(role => role.name == "Exempt from NoMoreAcronyms"));
|
||||
if (message.member.roles.cache.some(role => role.name == "Exempt from NoMoreAcronyms")) {
|
||||
message.react('🇵');
|
||||
message.react('🇴');
|
||||
message.react('🇬');
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
matchDetected = true;
|
||||
abbrsUsed++;
|
||||
//Return key
|
||||
|
Loading…
Reference in New Issue
Block a user