Save settings and shutdown
This commit is contained in:
parent
b117f9f4f4
commit
312a73a7c3
@ -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<insert randomized hug image here>'}, 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);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user