Exact date support, @everyone, new aliases

This commit is contained in:
Izwzyzx 2023-09-02 13:53:28 -05:00
parent 51a2a9f211
commit ad064a7d2c
2 changed files with 22 additions and 3 deletions

1
.gitignore vendored
View File

@ -1,5 +1,6 @@
# ignore all files in export dir
export/
modules/
# ignore bot settings file
settings.json

View File

@ -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 <target>`: The classic mIRC troutslap.\n`?hug <target (optional)>`: 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<String> = [];
// 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