From 434c25999645ef78fd094010fbb9b44da18c3d58 Mon Sep 17 00:00:00 2001 From: Oggetto Date: Thu, 7 Nov 2024 11:45:40 +0100 Subject: [PATCH] fix: stop using Zeres lib to get LocaleManager module (#223) --- ShowHiddenChannels.plugin.js | 24 ++++++++++++------------ src/config.json | 14 +++++++------- src/index.js | 12 ++++++------ src/utils/modules.js | 8 ++++---- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/ShowHiddenChannels.plugin.js b/ShowHiddenChannels.plugin.js index d6d2035..c358671 100644 --- a/ShowHiddenChannels.plugin.js +++ b/ShowHiddenChannels.plugin.js @@ -1,7 +1,7 @@ /** * @name ShowHiddenChannels * @displayName Show Hidden Channels (SHC) - * @version 0.5.5 + * @version 0.5.6 * @author JustOptimize (Oggetto) * @authorId 619203349954166804 * @source https://github.com/JustOptimize/ShowHiddenChannels @@ -580,7 +580,6 @@ const { ReactDOM, GuildChannelsStore, GuildMemberStore, - LocaleManager, NavigationUtils, ImageResolver, UserStore, @@ -598,6 +597,7 @@ const Utils = window.BdApi?.Utils; const BetterWebpackModules = window.BdApi.Webpack; const GuildStore = WebpackModules?.getByProps('getGuild', 'getGuildCount', 'getGuildIds', 'getGuilds', 'isLoaded'); +const LocaleManager = WebpackModules?.getByProps('setLocale'); const DiscordConstants = {}; @@ -661,11 +661,11 @@ if (!ChannelPermissionStore?.can) { const PermissionStoreActionHandler = Utils?.findInTree( Dispatcher, - (c) => c?.name == 'PermissionStore' && typeof c?.actionHandler?.CONNECTION_OPEN === 'function' + (c) => c?.name === 'PermissionStore' && typeof c?.actionHandler?.CONNECTION_OPEN === 'function' )?.actionHandler; const ChannelListStoreActionHandler = Utils?.findInTree( Dispatcher, - (c) => c?.name == 'ChannelListStore' && typeof c?.actionHandler?.CONNECTION_OPEN === 'function' + (c) => c?.name === 'ChannelListStore' && typeof c?.actionHandler?.CONNECTION_OPEN === 'function' )?.actionHandler; const container = WebpackModules?.getByProps('container', 'hubContainer')?.container; @@ -799,7 +799,7 @@ function checkVariables() { for (const variable in UsedModules) { if (!UsedModules[variable]) { - Logger.err('Variable not found: ' + variable); + Logger.err(`Variable not found: ${variable}`); } } @@ -901,11 +901,17 @@ const config = { ], description: "A plugin which displays all hidden Channels and allows users to view information about them, this won't allow you to read them (impossible).", - version: "0.5.5", + version: "0.5.6", github: 'https://github.com/JustOptimize/ShowHiddenChannels', }, changelog: [ + { + title: 'v0.5.6 - Fix Missing Module (LocaleManager)', + items: [ + 'Fixed missing LocaleManager module.', + ], + }, { title: 'v0.5.5 - Fix Crash', items: [ @@ -918,12 +924,6 @@ const config = { 'Fix Crash when muting/unmuting specific servers. (#214)', ], }, - { - title: 'v0.5.3 - Module Fix', - items: [ - 'Removed deprecated rolePill module.', - ], - }, ], main: 'ShowHiddenChannels.plugin.js', diff --git a/src/config.json b/src/config.json index b65b937..a27c366 100644 --- a/src/config.json +++ b/src/config.json @@ -1,9 +1,9 @@ { - "name": "ShowHiddenChannels", - "displayName": "Show Hidden Channels (SHC)", - "version": "0.5.5", - "author": "JustOptimize (Oggetto)", - "authorId": "619203349954166804", - "source": "https://github.com/JustOptimize/ShowHiddenChannels", - "description": "A plugin which displays all hidden Channels and allows users to view information about them, this won't allow you to read them (impossible)." + "name": "ShowHiddenChannels", + "displayName": "Show Hidden Channels (SHC)", + "version": "0.5.6", + "author": "JustOptimize (Oggetto)", + "authorId": "619203349954166804", + "source": "https://github.com/JustOptimize/ShowHiddenChannels", + "description": "A plugin which displays all hidden Channels and allows users to view information about them, this won't allow you to read them (impossible)." } diff --git a/src/index.js b/src/index.js index 5c5cdb2..a0457a9 100644 --- a/src/index.js +++ b/src/index.js @@ -15,6 +15,12 @@ const config = { }, changelog: [ + { + title: 'v0.5.6 - Fix Missing Module', + items: [ + 'Fixed missing LocaleManager module.', + ], + }, { title: 'v0.5.5 - Fix Crash', items: [ @@ -27,12 +33,6 @@ const config = { 'Fix Crash when muting/unmuting specific servers. (#214)', ], }, - { - title: 'v0.5.3 - Module Fix', - items: [ - 'Removed deprecated rolePill module.', - ], - }, ], main: 'ShowHiddenChannels.plugin.js', diff --git a/src/utils/modules.js b/src/utils/modules.js index 8229896..7320fe7 100644 --- a/src/utils/modules.js +++ b/src/utils/modules.js @@ -26,7 +26,6 @@ const { ReactDOM, GuildChannelsStore, GuildMemberStore, - LocaleManager, NavigationUtils, ImageResolver, UserStore, @@ -44,6 +43,7 @@ const Utils = window.BdApi?.Utils; const BetterWebpackModules = window.BdApi.Webpack; const GuildStore = WebpackModules?.getByProps('getGuild', 'getGuildCount', 'getGuildIds', 'getGuilds', 'isLoaded'); +const LocaleManager = WebpackModules?.getByProps('setLocale'); const DiscordConstants = {}; @@ -107,11 +107,11 @@ if (!ChannelPermissionStore?.can) { const PermissionStoreActionHandler = Utils?.findInTree( Dispatcher, - (c) => c?.name == 'PermissionStore' && typeof c?.actionHandler?.CONNECTION_OPEN === 'function' + (c) => c?.name === 'PermissionStore' && typeof c?.actionHandler?.CONNECTION_OPEN === 'function' )?.actionHandler; const ChannelListStoreActionHandler = Utils?.findInTree( Dispatcher, - (c) => c?.name == 'ChannelListStore' && typeof c?.actionHandler?.CONNECTION_OPEN === 'function' + (c) => c?.name === 'ChannelListStore' && typeof c?.actionHandler?.CONNECTION_OPEN === 'function' )?.actionHandler; const container = WebpackModules?.getByProps('container', 'hubContainer')?.container; @@ -245,7 +245,7 @@ function checkVariables() { for (const variable in UsedModules) { if (!UsedModules[variable]) { - Logger.err('Variable not found: ' + variable); + Logger.err(`Variable not found: ${variable}`); } }