diff --git a/util/login.js b/util/login.js index bb52d90..d1597fe 100644 --- a/util/login.js +++ b/util/login.js @@ -26,6 +26,20 @@ module.exports.run = () => { ]) ); resolve(); + + // Set the bot's activity and update it every 60 seconds in case it gets reset + let setActivity = () => { + try { + // Activity type 5 corresponds to 'Competing in': https://discord.com/developers/docs/game-sdk/activities#data-models-activitytype-enum + client.user.setPresence({ activity: { type: 5, name: 'being Obama' }, status: 'dnd' }) + .then(() => logger.debug('Updated activity')); + } catch(e) { + console.error(e); + } + } + + setActivity(); + setInterval(setActivity, (1000 * 60)); }); }); } \ No newline at end of file