]> git.puffer.fish Git - matthieu/gru.git/commitdiff
add everyone gif
authorMatthieu Pignolet <matthieu@matthieu-dev.xyz>
Sun, 7 Jul 2024 14:42:40 +0000 (18:42 +0400)
committerMatthieu Pignolet <matthieu@matthieu-dev.xyz>
Sun, 7 Jul 2024 14:42:40 +0000 (18:42 +0400)
discordjs/src/index.mjs

index faa94f3b71a6db7562d2db529996250bfb00d0b9..caee4b2fa771b9867bc8b09cab3164dadcb06b24 100644 (file)
@@ -40,8 +40,8 @@ const sanitizeWord = (sentence) => {
     .replaceAll(/([^A-z])/g, "");
   return lastWord;
 };
-const re = /([a-z]|[A-Z])+/g;
-const countChars = (str) => ((str || '').match(re) || []).length;
+const anyTrivialCharRegex = /([a-z]|[A-Z])+/g;
+const countChars = (str) => ((str || '').match(anyTrivialCharRegex) || []).length;
 
 const specialChannels = [
   "1248226018406301696"
@@ -59,6 +59,10 @@ const messageAction = async (message) => {
       message.reply(response);
     }
   }
+
+  if (message.content.includes("@everyone")) {
+    message.reply("https://tenor.com/fr/view/muppetwiki-muppet-wiki-muppets-muppet-angry-gif-4979240094074316588");
+  }
 };
 
 client.on("messageCreate", messageAction);