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
461ce43594
commit
846a346ad9
17
main.ts
17
main.ts
@ -127,15 +127,16 @@ function checkMessage(message) {
|
|||||||
var rebuildMessageArray = [];
|
var rebuildMessageArray = [];
|
||||||
//console.log("Corrected Message: " + correctedMessage);
|
//console.log("Corrected Message: " + correctedMessage);
|
||||||
if (!message.author.bot) {
|
if (!message.author.bot) {
|
||||||
if (abbreviationKey.target_phrases[matchMessageArray[i]] !== undefined) {
|
if (abbreviationKey.target_phrases[matchMessageArray[i]] !== undefined) {
|
||||||
console.log("Has role? " + message.member.roles.cache.some(role => role.name == "Exempt from NoMoreAcronyms"));
|
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")) {
|
if (message.member.roles.cache.some(role => role.name == "Exempt from NoMoreAcronyms")) {
|
||||||
message.react('🇵');
|
message.react('🇵');
|
||||||
message.react('🇴');
|
message.react('🇴');
|
||||||
message.react('🇬');
|
message.react('🇬');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
matchDetected = true;
|
matchDetected = true;
|
||||||
abbrsUsed++;
|
abbrsUsed++;
|
||||||
//Return key
|
//Return key
|
||||||
|
Loading…
x
Reference in New Issue
Block a user