From 8c4ccefbc3389409f55bd41b3ecd9966a5801df5 Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Fri, 15 Mar 2024 14:52:38 +0100 Subject: [PATCH] Update EditRoles.plugin.js --- Plugins/EditRoles/EditRoles.plugin.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Plugins/EditRoles/EditRoles.plugin.js b/Plugins/EditRoles/EditRoles.plugin.js index aa7a31bd80..90acb99938 100644 --- a/Plugins/EditRoles/EditRoles.plugin.js +++ b/Plugins/EditRoles/EditRoles.plugin.js @@ -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 @@ -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) {