commit 23124debcc2f101dffca6207413cc4ef640f28ae
parent 7a63882b900ebae1a2037d74c922063c89371f44
Author: Agastya Chandrakant <acagastya@outlook.com>
Date: Sat, 6 Jun 2020 00:23:52 +0530
thx regex
Diffstat:
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/irc.js b/irc.js
@@ -88,9 +88,8 @@ async function sayShortUrls(
}
function groupChat(sender, channel, msg) {
- const lcMsg = msg.toLowerCase();
- if (lcMsg.includes(`thanks ${botName}`))
- client.say(channel, `You are welcome, ${sender}.`);
+ const thanksRegex = new RegExp(`thanks,? ${botName}`, 'i');
+ if (thanksRegex.test(msg)) client.say(channel, `You are welcome, ${sender}.`);
if (msg.includes(`${botName} !RQ`)) announceRQ(sender, channel);
if (msg.includes(`${botName} !FB`)) fallback();
if (msg.includes(`${botName} !TRY`)) reset();
diff --git a/promUrlShortener.js b/promUrlShortener.js
@@ -113,7 +113,6 @@ async function main() {
main();
async function short(URI) {
- console.log(globalState);
if (!globalState.mainExecuted) main();
if (!URI)
URI =