From c4fc9ac8e077d2d1a7d00f8abcd8da2e5e77578f Mon Sep 17 00:00:00 2001 From: sadan4 <117494111+sadan4@users.noreply.github.com> Date: Fri, 21 Mar 2025 08:18:12 -0400 Subject: [PATCH] Fix plugins for Discord update (#3298) Co-authored-by: Nuckyz <61953774+Nuckyz@users.noreply.github.com> --- src/plugins/accountPanelServerProfile/index.tsx | 4 ++-- src/plugins/alwaysAnimate/index.ts | 6 +++--- src/plugins/decor/index.tsx | 2 +- src/plugins/ignoreActivities/index.tsx | 9 +-------- src/plugins/noBlockedMessages/index.ts | 4 ++-- 5 files changed, 9 insertions(+), 16 deletions(-) diff --git a/src/plugins/accountPanelServerProfile/index.tsx b/src/plugins/accountPanelServerProfile/index.tsx index d9fc9de1..30403f84 100644 --- a/src/plugins/accountPanelServerProfile/index.tsx +++ b/src/plugins/accountPanelServerProfile/index.tsx @@ -73,8 +73,8 @@ export default definePlugin({ group: true, replacement: [ { - match: /(?<=\.AVATAR_SIZE\).{0,100};)(?=return)/, - replace: "$self.useAccountPanelRef();" + match: /let{speaking:\i/, + replace: "$self.useAccountPanelRef();$&" }, { match: /(\.AVATAR,children:.+?renderPopout:(\i)=>){(.+?)}(?=,position)(?<=currentUser:(\i).+?)/, diff --git a/src/plugins/alwaysAnimate/index.ts b/src/plugins/alwaysAnimate/index.ts index a5297445..8edae08b 100644 --- a/src/plugins/alwaysAnimate/index.ts +++ b/src/plugins/alwaysAnimate/index.ts @@ -44,15 +44,15 @@ export default definePlugin({ find: "#{intl::GUILD_OWNER}),children:", replacement: { match: /(\.CUSTOM_STATUS.+?animate:)\i/, - replace: (_, rest) => `${rest}!0` + replace: "$1!0" } }, { // Guild Banner find: ".animatedBannerHoverLayer,onMouseEnter:", replacement: { - match: /(?<=guildBanner:\i,animate:)\i(?=}\))/, - replace: "!0" + match: /(\.headerContent.+?guildBanner:\i,animate:)\i/, + replace: "$1!0" } } ] diff --git a/src/plugins/decor/index.tsx b/src/plugins/decor/index.tsx index 4801cf75..63963d09 100644 --- a/src/plugins/decor/index.tsx +++ b/src/plugins/decor/index.tsx @@ -99,7 +99,7 @@ export default definePlugin({ }, // Current user area, at bottom of channels/dm list { - find: "renderAvatarWithPopout(){", + find: "#{intl::ACCOUNT_SPEAKING_WHILE_MUTED}", replacement: [ // Use Decor avatar decoration hook { diff --git a/src/plugins/ignoreActivities/index.tsx b/src/plugins/ignoreActivities/index.tsx index 9e9610f6..b0889186 100644 --- a/src/plugins/ignoreActivities/index.tsx +++ b/src/plugins/ignoreActivities/index.tsx @@ -260,14 +260,7 @@ export default definePlugin({ replace: (m, props, nowPlaying) => `${m}$self.renderToggleGameActivityButton(${props},${nowPlaying}),` } }, - // Discord has 2 different components for activities. Currently, the last is the one being used - { - find: ".activityTitleText,variant", - replacement: { - match: /\.activityTitleText.+?children:(\i)\.name.*?}\),/, - replace: (m, props) => `${m}$self.renderToggleActivityButton(${props}),` - }, - }, + // Activities from the apps launcher in the bottom right of the chat bar { find: ".promotedLabelWrapperNonBanner,children", replacement: { diff --git a/src/plugins/noBlockedMessages/index.ts b/src/plugins/noBlockedMessages/index.ts index 95b53c6b..efa4ed08 100644 --- a/src/plugins/noBlockedMessages/index.ts +++ b/src/plugins/noBlockedMessages/index.ts @@ -57,10 +57,10 @@ export default definePlugin({ patches: [ { - find: "#{intl::BLOCKED_MESSAGES_HIDE}", + find: ".__invalid_blocked,", replacement: [ { - match: /let\{[^}]*collapsedReason[^}]*\}/, + match: /let{expanded:\i,[^}]*?collapsedReason[^}]*}/, replace: "if($self.shouldHide(arguments[0]))return null;$&" } ]