Set activity
This commit is contained in:
parent
e3c471e390
commit
955fe8c462
|
@ -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));
|
||||
});
|
||||
});
|
||||
}
|
Loading…
Reference in a new issue