diff --git a/Onequestionmark.hx b/Onequestionmark.hx index c77cc48..019484a 100644 --- a/Onequestionmark.hx +++ b/Onequestionmark.hx @@ -58,7 +58,7 @@ class Onequestionmark { if (m.author.id == settings.botowner) { m.reply({content:"Shutdown command received from botowner, exiting."}, false); Sys.println("Shutdown command received from botowner, exiting."); - Sys.exit(0); + shutdown(); } // System for WIP commands that only work in testing server case "wipcommand": @@ -74,6 +74,9 @@ class Onequestionmark { 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); + // Image database commands + case "hug": + m.reply({content:'🫂 *hugs ${msg}*\n'}, false); } } @@ -81,4 +84,13 @@ class Onequestionmark { if ((msg.charAt(0) == ".") && (msg.length == 1)) {m.reply({content:"omg a meteor"}, true);} } } + + public static function saveSettings() { + File.saveContent("settings.json", Json.stringify(settings, "\t")); + } + + public static function shutdown() { + saveSettings(); + Sys.exit(0); + } } \ No newline at end of file