Update EditRoles.plugin.js

This commit is contained in:
Mirco Wittrien 2024-03-15 14:52:38 +01:00
parent 3b33c83ee2
commit 8c4ccefbc3
1 changed files with 5 additions and 2 deletions

View File

@ -2,7 +2,7 @@
* @name EditRoles * @name EditRoles
* @author DevilBro * @author DevilBro
* @authorId 278543574059057154 * @authorId 278543574059057154
* @version 1.1.8 * @version 1.1.9
* @description Allows you to locally edit Roles * @description Allows you to locally edit Roles
* @invite Jx3TjNS * @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien * @donate https://www.paypal.me/MircoWittrien
@ -275,7 +275,10 @@ module.exports = (_ => {
} }
getGuildFromRoleId (roleId) { 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) { resetRoles (id) {