From ad064a7d2c4c91727f2c5c394271c3bcaf74f788 Mon Sep 17 00:00:00 2001 From: Izwzyzx <184772711+Izwzyzx@users.noreply.github.com> Date: Sat, 2 Sep 2023 13:53:28 -0500 Subject: [PATCH] Exact date support, @everyone, new aliases --- .gitignore | 1 + Onequestionmark.hx | 24 +++++++++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index ea05849..5cefe34 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # ignore all files in export dir export/ +modules/ # ignore bot settings file settings.json \ No newline at end of file diff --git a/Onequestionmark.hx b/Onequestionmark.hx index b780960..94e3155 100644 --- a/Onequestionmark.hx +++ b/Onequestionmark.hx @@ -91,7 +91,7 @@ class Onequestionmark { // Commands that require authorization case "quit": if (m.author.id == settings.botowner) { - m.reply({content:"Shutdown command received from botowner, exiting."}, false); + m.react('✅'); Sys.println('[${timestamp()}] Shutdown command received from botowner, exiting'); shutdown(); } @@ -127,12 +127,25 @@ class Onequestionmark { **onequestionmark bot commands**\n`?chk`: ack\n`?slap `: The classic mIRC troutslap.\n`?hug `: Posts randomized hug image.\n`?yes` and `?no`: Posts randomized yes/no.\n`?angery`\n`?subway`\n`?motd`: Enables MOTD for current channel (requires auth)\n`?devmode`: Toggles Dev Mode (requires auth)\n`?quit`: Shutdown command (requires auth)\n**Non-command bot functions:**\n*MOTD*: Bot will post a randomized *Meme of the Day* in enabled channels.\n*Icce*: Bot provides users with ice cuboids.\n*Meteor*: Bot reacts to falling rocks in the chat.'}, false); case "chk": m.reply({content:'<@${m.author.id}>: ack'}, false); + case "mrkrabs": + m.reply({content:'<@${m.author.id}>: ack ack ack ack ack'}, false); case "slap": if (msg.length != 0) {m.reply({content:'*onequestionmark slaps ${msg} around a bit with a large trout*'}, false);} + // Basic aliases case "angery": m.reply({content:"https://cdn.discordapp.com/attachments/1071547517847732305/1079518504413311108/angery.jpg"}, false); case "subway": m.reply({content:"https://www.youtube.com/watch?v=y3VRXVvr6XU"}, false); + case "illuminati": + m.reply({content:"https://cdn.discordapp.com/attachments/1071547517847732305/1147204253039984671/illuminati.gif"}, false); + case "cube": + m.reply({content:"https://cdn.discordapp.com/attachments/270113422232911883/502690458779123722/the_cube.jpg"}, false); + case "coolsville": + m.reply({content:"https://cdn.discordapp.com/attachments/1071547517847732305/1147583765212835921/coolsville.gif"}, false); + case "tufac": + m.reply({content:"*Not Teh Face, but better,*\n*Tufac to the letter!*\n*Always two faces, never one,*\n*Tufac has you on the run!*"}, false); + case "communism": + m.reply({content:"https://cdn.discordapp.com/attachments/1071547517847732305/1147590229960691742/communism.gif"}, false); // Image database commands case "hug": m.reply({content:'🫂 *hugs ${msg}*\n${hugDB[randInt(0, hugDB.length-1)]}'}, false); @@ -148,6 +161,7 @@ class Onequestionmark { // Non-command responses if ((msg.charAt(0) == ".") && (msg.length == 1)) {m.reply({content:"omg a meteor"}, true);} if ((iceRegex.match(msg)) && (m.author.id != botInfo.id)) {m.reply({content:"Did some carbon-based lifeform just say **I C E**?"});} + if ((m.mention_everyone == true) && (msg.charAt(0) != "?")) {m.reply({content:"https://cdn.discordapp.com/attachments/1071547517847732305/1147598637241741343/at_everyone.jpg"}, true);} } } @@ -240,8 +254,12 @@ class Onequestionmark { var msg = ""; var day:Array = []; - // Check for special date - if (motdDB.exists(monthdate())) { + // Check for exact date + if (motdDB.exists('${monthdate()}-${Date.now().getFullYear()}')) { + day = motdDB.get('${monthdate()}-${Date.now().getFullYear()}'); + } + // Else, check for special date + else if (motdDB.exists(monthdate())) { day = motdDB.get(monthdate()); } // Else, check for special day/date combo