From e05c630a5497e37701cfd707334512d888895259 Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Fri, 27 Oct 2023 14:29:25 -0300 Subject: [PATCH] SHC: Make Chat Input Bar channel list include hidden channels --- src/plugins/showHiddenChannels/index.tsx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/plugins/showHiddenChannels/index.tsx b/src/plugins/showHiddenChannels/index.tsx index 4d828acd..95b16d62 100644 --- a/src/plugins/showHiddenChannels/index.tsx +++ b/src/plugins/showHiddenChannels/index.tsx @@ -414,6 +414,22 @@ export default definePlugin({ } ] }, + { + // Make the chat input bar channel list contain hidden channels + find: ",queryStaticRouteChannels(", + replacement: [ + { + // Make the getChannels call to GuildChannelStore return hidden channels + match: /(?<=queryChannels\(\i\){.+?getChannels\(\i)(?=\))/, + replace: ",true" + }, + { + // Avoid filtering out hidden channels from the channel list + match: /(?<=queryChannels\(\i\){.+?isGuildChannelType\)\((\i)\.type\))(?=&&!\i\.\i\.can\()/, + replace: "&&!$self.isHiddenChannel($1)" + } + ] + }, { find: "\"^/guild-stages/(\\\\d+)(?:/)?(\\\\d+)?\"", replacement: {