Skip to content

Commit

Permalink
emergency fix: missing condition
Browse files Browse the repository at this point in the history
  • Loading branch information
tomli380576 committed Sep 15, 2022
1 parent c89830a commit 8432b50
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/attending-server/base-attending-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,9 @@ class AttendingServerV2 {
// Give everyone the student role
const studentRole = this.guild.roles.cache.find(role => role.name === 'Student');
await Promise.all(this.guild.members.cache.map(async member => {
if (member.user.id !== this.user.id && studentRole) {
if (member.user.id !== this.user.id &&
studentRole &&
!member.roles.cache.has(studentRole.id)) {
await member.roles.add(studentRole);
}
}));
Expand Down

0 comments on commit 8432b50

Please sign in to comment.