This commit is contained in:
Lamp 2018-08-10 20:35:39 -07:00
parent bd8c6ee7d2
commit 86c5a54417
No known key found for this signature in database
GPG Key ID: 0F1F8704BEDE369E
1 changed files with 5 additions and 4 deletions

View File

@ -80,13 +80,14 @@ colorRoles.pruneOrphanRoles = async function() { // delete all color roles that
// event listeners
dClient.on('presenceUpdate', (oldMember, newMember) => { // update color role on presence update // emitted also on member join
dClient.on('presenceUpdate', async (oldMember, newMember) => { // update color role on presence update // emitted also on member join
if (!oldMember.presence || !newMember.presence) return;
if (oldMember.presence.status != newMember.presence.status) {
colorRoles.update(newMember);
await colorRoles.update(newMember);
}
});
dClient.on('guildMemberRemove', member => { // update (delete) color role on member leave
colorRoles.update(member);
dClient.on('guildMemberRemove', async member => { // update (delete) color role on member leave
await colorRoles.update(member);
});