From 01e63f27b665a87510b41ca818349693f1bfece7 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Tue, 13 Aug 2019 19:59:33 +0300 Subject: [PATCH] Re-apply bot status every hour --- src/main.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.js b/src/main.js index ac0a6f7..23085d1 100644 --- a/src/main.js +++ b/src/main.js @@ -67,7 +67,13 @@ function waitForGuild(guildId) { } function initStatus() { - bot.editStatus(null, {name: config.status}); + function applyStatus() { + bot.editStatus(null, {name: config.status}); + } + + // Set the bot status initially, then reapply it every hour since in some cases it gets unset + applyStatus(); + setInterval(applyStatus, 60 * 60 * 1000); } function initBaseMessageHandlers() {