fix plugins broken by Discord update (#3583)

Co-authored-by: Nuckyz <61953774+Nuckyz@users.noreply.github.com>
Co-authored-by: V <vendicated@riseup.net>
This commit is contained in:
sadan4 2025-08-06 16:16:07 -04:00 committed by GitHub
parent 36c15d619e
commit 6a66b7f54f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 12 additions and 24 deletions

View file

@ -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}`
}
]
}

View file

@ -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: {

View file

@ -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"
}
}
]

View file

@ -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

View file

@ -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)"
}
},
{

View file

@ -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,"
}
}