From d0ee15b4e9e4d2025cc700152df81daef71332c6 Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Mon, 17 May 2021 16:35:25 -0600 Subject: [PATCH] statuses --- src/modules/status.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/modules/status.js diff --git a/src/modules/status.js b/src/modules/status.js new file mode 100644 index 0000000..f8cf6b9 --- /dev/null +++ b/src/modules/status.js @@ -0,0 +1,21 @@ +const statuses = [ + {type: 0, text: "on %servers% servers"}, + {type: 0, text: "with %users% users"}, + {type: 0, text: "with %commands% commands"}, +]; + +function setStatus() { + const status = statuses[Math.floor(Math.random() * statuses.length)]; + const text = status.text + .replace("%servers%", hf.bot.guilds.size) + .replace("%users%", hf.bot.users.size) + .replace("%commands%", hf.commands.size); + + hf.bot.editStatus("online", { + type: status.type, + name: `${text} | ${hf.config.prefix}help`, + }); +} + +hf.bot.once("ready", setStatus); +hf.timer.add("status", setStatus, 300000);