diff --git a/main.cjs b/main.cjs index 2b45cee..b90a060 100644 --- a/main.cjs +++ b/main.cjs @@ -120,25 +120,26 @@ client.on('messageCreate', message => { if (global.madlibState.gameChannel == message.channel.id && message.author.id != "1091120267851485215") { // Pass message to madlib game handler if message was sent in the active game channel. madlibNextMessage(message.content, client); } - checkMessage(message); + checkMessage(message, false); }); client.on('messageUpdate', (undefined, newMessage) => { - checkMessage(newMessage); + checkMessage(newMessage, false); }); -global.checkMessage = function checkMessage(message) { - checkInsult(message); - if (message.content == "<@1091120267851485215>, what are your pronouns?") { - message.reply({ content: "My pronouns are she/her ☺️", allowedMentions: { repliedUser: false } }) +global.checkMessage = function checkMessage(message, ranFromGlobal) { + if (!runFromGlobal) { + checkInsult(message); + if (message.content == "<@1091120267851485215>, what are your pronouns?") { + message.reply({ content: "My pronouns are she/her ☺️", allowedMentions: { repliedUser: false } }) + } + if (message.author.id == "1091120267851485215") { + return; + } + console.log(`${message.author.tag} in #${message.channel.name} sent: ${message.content}`); } - console.log(`${message.author.tag} in #${message.channel.name} sent: ${message.content}`); //console.log(message.author); - if (message.author.id == "1091120267851485215") { - return; - } - var matchMessageArray = message.content.toLowerCase().split(/[ ,!?\"@#$%^&*().;:|]+/); console.log(matchMessageArray);