Skip to content

Commit

Permalink
chore: move guild getter logic outside the loop
Browse files Browse the repository at this point in the history
  • Loading branch information
almostSouji committed Aug 2, 2021
1 parent c44c541 commit 3434c6f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/structures/MessageMentions.js
Expand Up @@ -69,8 +69,9 @@ class MessageMentions {
this.roles = new Collection(roles);
} else {
this.roles = new Collection();
const guild = message.guild;
for (const mention of roles) {
const role = message.guild.roles.cache.get(mention);
const role = guild.roles.cache.get(mention);
if (role) this.roles.set(role.id, role);
}
}
Expand Down

0 comments on commit 3434c6f

Please sign in to comment.