Added Hug image database
This commit is contained in:
parent
baa65bb9ef
commit
de68c2f012
@ -12,6 +12,7 @@ class Onequestionmark {
|
||||
static var settings:Dynamic;
|
||||
static var botInfo:Dynamic;
|
||||
static var iceRegex:EReg = ~/\bicc?ed?\b/i;
|
||||
static var hugDB:Array<String>;
|
||||
|
||||
static function main() {
|
||||
|
||||
@ -26,6 +27,14 @@ class Onequestionmark {
|
||||
Sys.exit(0);
|
||||
}
|
||||
|
||||
if (FileSystem.exists("hug-db.json")) {
|
||||
Sys.println('[${timestamp()}] Found hug-db.json, loading');
|
||||
hugDB = Json.parse(File.getContent("hug-db.json"));
|
||||
} else {
|
||||
Sys.println('[${timestamp()}] Did not find hug-db.json, skipping');
|
||||
hugDB = ["https://cdn.discordapp.com/attachments/270113422232911883/445026464623099907/brohugbump.gif"]; // Fallback
|
||||
}
|
||||
|
||||
// Start the bot
|
||||
Bot = new DiscordClient(settings.token, [3276799], settings.debug);
|
||||
Bot.onReady = onReady;
|
||||
@ -86,6 +95,7 @@ class Onequestionmark {
|
||||
settings.motd.channels.remove(m.channel_id);
|
||||
m.reply({content:'MOTD has been disabled for <#${m.channel_id}>'}, false);
|
||||
}
|
||||
saveSettings();
|
||||
}
|
||||
// System for WIP commands that only work in testing server
|
||||
case "wipcommand":
|
||||
@ -106,7 +116,7 @@ class Onequestionmark {
|
||||
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);
|
||||
m.reply({content:'🫂 *hugs ${msg}*\n${hugDB[randInt(0, hugDB.length-1)]}'}, false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -133,6 +143,8 @@ class Onequestionmark {
|
||||
|
||||
if ((settings.motd.posted == false) && (Date.now().getHours() >= settings.motd.time)) {
|
||||
settings.motd.posted = true;
|
||||
saveSettings();
|
||||
|
||||
var msg = "";
|
||||
//events
|
||||
switch (Date.now().getDay()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user