Skip to content

Commit

Permalink
fix roles change check
Browse files Browse the repository at this point in the history
  • Loading branch information
lenisko committed Apr 10, 2021
1 parent de54c67 commit ec77469
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/services/events/guildMemberUpdate.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ module.exports = async (client, oldPresence, newPresence) => {
const rolesAfter = newPresence.roles.cache
.filter(x => BigInt(x.id).toString())
.keyArray();
const perms = Object.values(client.config.discord.perms)
const perms = [...new Set(
Object.values(client.config.discord.perms)
.map(x => x.roles)
.reduce(x => [...x]);
.flat()
)];
const roleDiff = rolesBefore
.filter(x => !rolesAfter.includes(x))
.concat(rolesAfter
Expand Down

0 comments on commit ec77469

Please sign in to comment.