Skip to content

Commit

Permalink
Update EditRoles.plugin.js
Browse files Browse the repository at this point in the history
  • Loading branch information
mwittrien committed Mar 15, 2024
1 parent 3b33c83 commit 8c4ccef
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Plugins/EditRoles/EditRoles.plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @name EditRoles
* @author DevilBro
* @authorId 278543574059057154
* @version 1.1.8
* @version 1.1.9
* @description Allows you to locally edit Roles
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
Expand Down Expand Up @@ -275,7 +275,10 @@ module.exports = (_ => {
}

getGuildFromRoleId (roleId) {
return BDFDB.LibraryStores.SortedGuildStore.getFlattenedGuildIds().map(BDFDB.LibraryStores.GuildStore.getGuild).find(g => g.roles[roleId]);
return BDFDB.LibraryStores.SortedGuildStore.getFlattenedGuildIds().map(BDFDB.LibraryStores.GuildStore.getGuild).find(guild => {
let roles = guild.roles || BDFDB.LibraryStores.GuildStore.getRoles(guild.id);
return roles && roles[roleId];
});
}

resetRoles (id) {
Expand Down

0 comments on commit 8c4ccef

Please sign in to comment.