From 6a66b7f54f3ef6693941c024004a163b6639a44c Mon Sep 17 00:00:00 2001 From: sadan4 <117494111+sadan4@users.noreply.github.com> Date: Wed, 6 Aug 2025 16:16:07 -0400 Subject: [PATCH] fix plugins broken by Discord update (#3583) Co-authored-by: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Co-authored-by: V --- src/plugins/_api/notices.ts | 4 ++-- src/plugins/reviewDB/index.tsx | 7 ------- src/plugins/showAllMessageButtons/index.ts | 5 +++-- src/plugins/showHiddenChannels/index.tsx | 12 +++--------- src/plugins/superReactionTweaks/index.ts | 4 ++-- src/plugins/vencordToolbox/index.tsx | 4 ++-- 6 files changed, 12 insertions(+), 24 deletions(-) diff --git a/src/plugins/_api/notices.ts b/src/plugins/_api/notices.ts index f0445924..89aa1a46 100644 --- a/src/plugins/_api/notices.ts +++ b/src/plugins/_api/notices.ts @@ -33,8 +33,8 @@ export default definePlugin({ replace: "if(Vencord.Api.Notices.currentNotice)return false;$&" }, { - match: /(?<=,NOTICE_DISMISS:function\(\i\){)return null!=(\i)/, - replace: "if($1?.id==\"VencordNotice\")return($1=null,Vencord.Api.Notices.nextNotice(),true);$&" + match: /(?<=function (\i)\(\i\){)return null!=(\i)(?=.+?NOTICE_DISMISS:\1)/, + replace: (m, _, notice) => `if(${notice}?.id=="VencordNotice")return(${notice}=null,Vencord.Api.Notices.nextNotice(),true);${m}` } ] } diff --git a/src/plugins/reviewDB/index.tsx b/src/plugins/reviewDB/index.tsx index d8374e6f..c5c102ae 100644 --- a/src/plugins/reviewDB/index.tsx +++ b/src/plugins/reviewDB/index.tsx @@ -83,13 +83,6 @@ export default definePlugin({ replace: "$&$self.BiteSizeReviewsButton({user:arguments[0].user})," } }, - { - find: ".MODAL,user:", - replacement: { - match: /children:\[(?=[^[]+?shouldShowTooltip:)/, - replace: "$&$self.BiteSizeReviewsButton({user:arguments[0].user})," - } - }, { find: ".SIDEBAR,shouldShowTooltip:", replacement: { diff --git a/src/plugins/showAllMessageButtons/index.ts b/src/plugins/showAllMessageButtons/index.ts index 1d689013..6ac17e5d 100644 --- a/src/plugins/showAllMessageButtons/index.ts +++ b/src/plugins/showAllMessageButtons/index.ts @@ -28,8 +28,9 @@ export default definePlugin({ { find: "#{intl::MESSAGE_UTILITIES_A11Y_LABEL}", replacement: { - match: /isExpanded:\i&&(.+?),/, - replace: "isExpanded:$1," + // isExpanded = isShiftPressed && other conditions... + match: /(?<=(\i)=)\i(?=&&.+?isExpanded:\1)/, + replace: "true" } } ] diff --git a/src/plugins/showHiddenChannels/index.tsx b/src/plugins/showHiddenChannels/index.tsx index 43cd677e..78c81d00 100644 --- a/src/plugins/showHiddenChannels/index.tsx +++ b/src/plugins/showHiddenChannels/index.tsx @@ -319,20 +319,14 @@ export default definePlugin({ replacement: [ { // Create a variable for the channel prop - match: /users:\i,maxUsers:\i.+?}=(\i).*?;/, - replace: (m, props) => `${m}let{shcChannel}=${props};` + match: /(function \i\(\i\)\{)([^}]+?hideOverflowCount)/, + replace: "$1let {shcChannel}=arguments[0];$2" }, { // Make Discord always render the plus button if the component is used inside the HiddenChannelLockScreen - match: /\i>0(?=&&.{0,30}Math.min)/, + match: /\i>0(?=&&!\i&&!\i)/, replace: m => `($self.isHiddenChannel(typeof shcChannel!=="undefined"?shcChannel:void 0,true)?true:${m})` }, - { - // Prevent Discord from overwriting the last children with the plus button - // if the overflow amount is <= 0 and the component is used inside the HiddenChannelLockScreen - match: /(?<=\i\.length-)1(?=\]=.{0,60}renderPopout)(?<=(\i)=\i\.length-\i.+?)/, - replace: (_, amount) => `($self.isHiddenChannel(typeof shcChannel!=="undefined"?shcChannel:void 0,true)&&${amount}<=0?0:1)` - }, { // Show only the plus text without overflowed children amount // if the overflow amount is <= 0 and the component is used inside the HiddenChannelLockScreen diff --git a/src/plugins/superReactionTweaks/index.ts b/src/plugins/superReactionTweaks/index.ts index 188f868a..b8aed478 100644 --- a/src/plugins/superReactionTweaks/index.ts +++ b/src/plugins/superReactionTweaks/index.ts @@ -42,8 +42,8 @@ export default definePlugin({ { find: ",BURST_REACTION_EFFECT_PLAY", replacement: { - match: /(BURST_REACTION_EFFECT_PLAY:\i=>{.{50,100})(\i\(\i,\i\))>=\d+/, - replace: "$1!$self.shouldPlayBurstReaction($2)" + match: /(?<=(\i)=\i=>{.+?)(\i\(\i,\i\))>=\i(?=\).+BURST_REACTION_EFFECT_PLAY:\1)/, + replace: "!$self.shouldPlayBurstReaction($2)" } }, { diff --git a/src/plugins/vencordToolbox/index.tsx b/src/plugins/vencordToolbox/index.tsx index 2f671a23..82cd0284 100644 --- a/src/plugins/vencordToolbox/index.tsx +++ b/src/plugins/vencordToolbox/index.tsx @@ -140,9 +140,9 @@ export default definePlugin({ patches: [ { - find: "toolbar:function", + find: ".controlButtonWrapper,", replacement: { - match: /(?<=toolbar:function.{0,100}\()\i.Fragment,/, + match: /(?<=function (\i).{0,100}\()\i.Fragment,(?=.+?toolbar:\1\(\))/, replace: "$self.ToolboxFragmentWrapper," } }