Set activity

This commit is contained in:
Jan 2020-12-27 14:32:23 +01:00
parent e3c471e390
commit 955fe8c462

View file

@ -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));
});
});
}