From ba8b5179eccafa09049b0b8463bae655317e8af0 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Thu, 23 Apr 2026 08:06:25 -0400 Subject: [PATCH] Apply Dev3 Fixes --- src/equicordplugins/blockKeywords/index.ts | 23 ++++++---- .../equibopStreamFixes.equibop/index.tsx | 12 +++--- src/plugins/consoleJanitor/index.tsx | 4 +- src/plugins/fakeNitro/index.tsx | 29 +------------ src/plugins/favEmojiFirst/index.tsx | 2 +- src/plugins/favGifSearch/index.tsx | 2 +- src/plugins/messageLogger/index.tsx | 42 ------------------- src/plugins/noBlockedMessages/index.ts | 22 ++++++---- src/plugins/showMeYourName/index.tsx | 2 +- src/plugins/volumeBooster/index.ts | 2 +- src/plugins/whoReacted/index.tsx | 4 +- 11 files changed, 44 insertions(+), 100 deletions(-) diff --git a/src/equicordplugins/blockKeywords/index.ts b/src/equicordplugins/blockKeywords/index.ts index 13b44744c..bbe146b46 100644 --- a/src/equicordplugins/blockKeywords/index.ts +++ b/src/equicordplugins/blockKeywords/index.ts @@ -81,19 +81,26 @@ export default definePlugin({ replace: "$&$1=$self.blockMessagesWithKeywords($1);" } }, - ...[ - '"MessageStore"', - '"ReadStateStore"' - ].map(find => ({ - find, + { + find: '"MessageStore"', predicate: () => settings.store.ignoreBlockedMessages && settings.store.blockedWords !== "", replacement: [ { - match: /(?<=function (\i)\((\i)\){)(?=.*MESSAGE_CREATE:\1)/, - replace: (_, _funcName, props) => `if($self.containsBlockedKeywords(${props}.message))return;` + match: /(?<=MESSAGE_CREATE:function\((\i)\){)/, + replace: (_, props) => `if($self.containsBlockedKeywords(${props}.message))return;` } ] - })), + }, + { + find: '"ReadStateStore"', + predicate: () => settings.store.ignoreBlockedMessages && settings.store.blockedWords !== "", + replacement: [ + { + match: /(?<=MESSAGE_CREATE:function\((\i)\){)/, + replace: (_, props) => `if($self.containsBlockedKeywords(${props}.message))return;` + } + ] + }, ], settings, diff --git a/src/equicordplugins/equibopStreamFixes.equibop/index.tsx b/src/equicordplugins/equibopStreamFixes.equibop/index.tsx index 2f6341ca1..9c553eb46 100644 --- a/src/equicordplugins/equibopStreamFixes.equibop/index.tsx +++ b/src/equicordplugins/equibopStreamFixes.equibop/index.tsx @@ -5,7 +5,7 @@ */ import { isPluginEnabled } from "@api/PluginManager"; -import { definePluginSettings } from "@api/Settings"; +import { definePluginSettings, Settings } from "@api/Settings"; import fakeNitro from "@plugins/fakeNitro"; import { EquicordDevs } from "@utils/constants"; import { localStorage } from "@utils/localStorage"; @@ -120,15 +120,15 @@ export default definePlugin({ find: "canUseCustomStickersEverywhere:", replacement: [ { - match: /canStreamQuality:\i,/, - replace: "canStreamQuality:()=>true,", + match: /(?<=canUseHighVideoUploadQuality:function\(\i\)\{)/, + replace: "return true;", }, { - match: /canUseHighVideoUploadQuality:\i,/, - replace: "canUseHighVideoUploadQuality:()=>true,", + match: /(?<=canStreamQuality:function\(\i,\i\)\{)/, + replace: "return true;", }, ], - predicate: () => settings.store.unlockQualityOptions && !isPluginEnabled(fakeNitro.name), + predicate: () => settings.store.unlockQualityOptions && !isPluginEnabled(fakeNitro.name) && !Settings.plugins[fakeNitro.name].enableStreamQualityBypass, noWarn: true, }, // remove guild premium tier restriction from stream fps options diff --git a/src/plugins/consoleJanitor/index.tsx b/src/plugins/consoleJanitor/index.tsx index b3e2d4f69..93f3a3d20 100644 --- a/src/plugins/consoleJanitor/index.tsx +++ b/src/plugins/consoleJanitor/index.tsx @@ -136,7 +136,7 @@ export default definePlugin({ { find: 'The "interpolate" function is deprecated in v10 (use "to" instead)', replacement: { - match: /,console.warn\(\i\+'The "interpolate" function is deprecated in v10 \(use "to" instead\)'\)/, + match: /,console.warn\('react-spring: The "interpolate" function is deprecated in v10 \(use "to" instead\)'\)/, replace: "" } }, @@ -197,7 +197,7 @@ export default definePlugin({ find: "Slow dispatch on", replacement: [ { - match: /\i\.totalTime>\i&&\i\.verbose\([`"]Slow dispatch on.{0,55}\);/, + match: /\i\.totalTime>\d+?&&\i\.verbose\([`"]Slow dispatch on.{0,55}\);/, replace: "" }, ] diff --git a/src/plugins/fakeNitro/index.tsx b/src/plugins/fakeNitro/index.tsx index 842345e40..e8d262754 100644 --- a/src/plugins/fakeNitro/index.tsx +++ b/src/plugins/fakeNitro/index.tsx @@ -23,7 +23,7 @@ import { ApngBlendOp, ApngDisposeOp, parseAPNG } from "@utils/apng"; import { Devs } from "@utils/constants"; import { getCurrentGuild } from "@utils/discord"; import { Logger } from "@utils/Logger"; -import definePlugin, { OptionType, Patch } from "@utils/types"; +import definePlugin, { OptionType } from "@utils/types"; import type { Emoji, Message, Sticker } from "@vencord/discord-types"; import { StickerFormatType } from "@vencord/discord-types/enums"; import { findByCodeLazy, findByPropsLazy, proxyLazyWebpack } from "@webpack"; @@ -157,26 +157,6 @@ const hasExternalStickerPerms = (channelId: string) => hasPermission(channelId, const hasEmbedPerms = (channelId: string) => hasPermission(channelId, PermissionsBits.EMBED_LINKS); const hasAttachmentPerms = (channelId: string) => hasPermission(channelId, PermissionsBits.ATTACH_FILES); -function makeBypassPatches(): Omit { - const mapping: Array<{ func: string, predicate?: () => boolean; }> = [ - { func: "canUseCustomStickersEverywhere", predicate: () => settings.store.enableStickerBypass }, - { func: "canUseHighVideoUploadQuality", predicate: () => settings.store.enableStreamQualityBypass }, - { func: "canStreamQuality", predicate: () => settings.store.enableStreamQualityBypass }, - { func: "canUseClientThemes" }, - { func: "canUsePremiumAppIcons" } - ]; - - return { - find: "canUseCustomStickersEverywhere:", - replacement: mapping.map(({ func, predicate }) => ({ - match: new RegExp(String.raw`(?<=${func}:)\i`), - replace: "() => true", - noWarn: true, - predicate - })) - }; -} - export default definePlugin({ name: "FakeNitro", authors: [Devs.Arjix, Devs.D3SOX, Devs.Ven, Devs.fawn, Devs.captain, Devs.Nuckyz, Devs.AutumnVN, Devs.sadan], @@ -187,8 +167,6 @@ export default definePlugin({ settings, patches: [ - // TODO: remove - makeBypassPatches(), { find: "canUseCustomStickersEverywhere:", replacement: [ @@ -292,11 +270,6 @@ export default definePlugin({ match: /(?<=CONNECTION_OPEN:function\((\i)\){)/, replace: (_, props) => `$self.handleProtoChange(${props}.userSettingsProto,${props}.user);` }, - { - match: /function (\i)\((\i)\){(?=.*CONNECTION_OPEN:\1)/, - replace: (m, funcName, props) => `${m}$self.handleProtoChange(${props}.userSettingsProto,${props}.user);`, - noWarn: true - }, { // Overwrite non local proto changes with our local settings match: /let{settings:/, diff --git a/src/plugins/favEmojiFirst/index.tsx b/src/plugins/favEmojiFirst/index.tsx index 4c6261d78..9d6279dbf 100644 --- a/src/plugins/favEmojiFirst/index.tsx +++ b/src/plugins/favEmojiFirst/index.tsx @@ -1143,7 +1143,7 @@ export default definePlugin({ replace: "$1Infinity" }, { - match: /(\i)\.slice\(0,(Math\.max\(\i,\i(?:-\i\.length){2}\))\)/, + match: /(\i)\.slice\(0,(Math\.max\(\d+?,\i(?:-\i\.length){2}\))\)/, replace: "($1.sliceTo = $2, $1)" } ] diff --git a/src/plugins/favGifSearch/index.tsx b/src/plugins/favGifSearch/index.tsx index 57926ef24..63e24821c 100644 --- a/src/plugins/favGifSearch/index.tsx +++ b/src/plugins/favGifSearch/index.tsx @@ -93,7 +93,7 @@ export default definePlugin({ { // https://regex101.com/r/07gpzP/1 // ($1 renderHeaderContent=function { ... switch (x) ... case FAVORITES:return) ($2) ($3 case default: ... return r.jsx(($), {...props})) - match: /(renderHeaderContent\(\).{1,150}FAVORITES:return)(.{1,150});(case.{1,200}default:.{0,50}?return\(0,\i\.jsx\)\((?\i\..{1,10}),)/, + match: /(renderHeaderContent\(\).{1,150}FAVORITES:return)(.{1,150});(case.{1,200}default:.{0,50}?return\(0,\i\.jsx\)\((?\i\.\i),)/, replace: "$1 this.state.resultType === 'Favorites' ? $self.renderSearchBar(this, $) : $2;$3" }, { diff --git a/src/plugins/messageLogger/index.tsx b/src/plugins/messageLogger/index.tsx index a60e6580f..527439258 100644 --- a/src/plugins/messageLogger/index.tsx +++ b/src/plugins/messageLogger/index.tsx @@ -679,16 +679,6 @@ export default definePlugin({ return; ` }, - { - noWarn: true, - match: /function (?=.+?MESSAGE_DELETE:(\i))\1\((\i)\){let.+?((?:\i\.){2})getOrCreate.+?}(?=function)/, - replace: - "function $1($2){" + - " var cache = $3getOrCreate($2.channelId);" + - " cache = $self.handleDelete(cache, $2, false);" + - " $3commit(cache);" + - "}" - }, { // Add deleted=true to all target messages in the MESSAGE_DELETE_BULK event match: /(?<=MESSAGE_DELETE_BULK:function\((\i)\){)(?=let.{0,100}(\i\.\i)\.getOrCreate)/, @@ -699,16 +689,6 @@ export default definePlugin({ return; ` }, - { - match: /function (?=.+?MESSAGE_DELETE_BULK:(\i))\1\((\i)\){let.+?((?:\i\.){2})getOrCreate.+?}(?=function)/, - noWarn: true, - replace: - "function $1($2){" + - " var cache = $3getOrCreate($2.channelId);" + - " cache = $self.handleDelete(cache, $2, true);" + - " $3commit(cache);" + - "}" - }, { // Add current cached content + new edit time to cached message's editHistory match: /(MESSAGE_UPDATE:function\((\i)\).+?)\.update\((\i)/, @@ -723,18 +703,6 @@ export default definePlugin({ .update($3 ` }, - { - noWarn: true, - match: /(function (\i)\((\i)\).+?)\.update\((\i)(?=.*MESSAGE_UPDATE:\2)/, - replace: "$1" + - ".update($4,m =>" + - " (($3.message.flags & 64) === 64 || $self.shouldIgnore($3.message, true)) ? m :" + - " $3.message.edited_timestamp && $3.message.content !== m.content ?" + - " m.set('editHistory',[...(m.editHistory || []), $self.makeEdit($3.message, m)]) :" + - " m" + - ")" + - ".update($4" - }, { // fix up key (edit last message) attempting to edit a deleted message match: /(?<=getLastEditableMessage\(\i\)\{.{0,200}\.find\((\i)=>)/, @@ -853,16 +821,6 @@ export default definePlugin({ { match: /(?<=MESSAGE_DELETE_BULK:function\(\i\)\{)/, replace: "return;" - }, - { - match: /MESSAGE_DELETE:\i,/, - replace: "MESSAGE_DELETE:()=>{},", - noWarn: true - }, - { - match: /MESSAGE_DELETE_BULK:\i,/, - replace: "MESSAGE_DELETE_BULK:()=>{},", - noWarn: true } ] }, diff --git a/src/plugins/noBlockedMessages/index.ts b/src/plugins/noBlockedMessages/index.ts index 4b6b312e4..5780d8b57 100644 --- a/src/plugins/noBlockedMessages/index.ts +++ b/src/plugins/noBlockedMessages/index.ts @@ -94,18 +94,24 @@ export default definePlugin({ isModified: true, settings, patches: [ - ...[ - '"MessageStore"', - '"ReadStateStore"' - ].map(find => ({ - find, + { + find: '"MessageStore"', replacement: [ { - match: /(?<=function (\i)\((\i)\){)(?=.*MESSAGE_CREATE:\1)/, - replace: (_, _funcName, props) => `if($self.disableNotification(${props}.message)){return;};` + match: /(?<=MESSAGE_CREATE:function\((\i)\){)/, + replace: (_, props) => `if($self.disableNotification(${props}.message))return;` } ] - })), + }, + { + find: '"ReadStateStore"', + replacement: [ + { + match: /(?<=MESSAGE_CREATE:function\((\i)\){)/, + replace: (_, props) => `if($self.disableNotification(${props}.message))return;` + } + ] + }, { find: "`forum-post-action-bar-", replacement: [ diff --git a/src/plugins/showMeYourName/index.tsx b/src/plugins/showMeYourName/index.tsx index bda540684..8ab2e2000 100644 --- a/src/plugins/showMeYourName/index.tsx +++ b/src/plugins/showMeYourName/index.tsx @@ -26,7 +26,7 @@ import { JSX } from "react"; const SMYNC = classNameFactory(); const UserStore = findStoreLazy("UserStore"); const wrapEmojis = findByCodeLazy("lastIndex;return"); -const adjustColor = findByCodeLazy("light1", "dark1", "toonStroke"); +const adjustColor = findByCodeLazy("light1", '.get("hsl.s"))'); const AccessibilityStore = findStoreLazy("AccessibilityStore"); const roleColorPattern = /^role((?:\+|-)\d{0,4})?$/iu; diff --git a/src/plugins/volumeBooster/index.ts b/src/plugins/volumeBooster/index.ts index e379686ad..ea4b5cd35 100644 --- a/src/plugins/volumeBooster/index.ts +++ b/src/plugins/volumeBooster/index.ts @@ -99,7 +99,7 @@ export default definePlugin({ find: "AudioContextSettingsMigrated", replacement: [ { - match: /(?<=isLocalMute\(\i,\i\),volume:(\i).+?\i\(\i,\i,)\1(?=\))/, + match: /(?<=isLocalMute\(\i,\i\),volume:(\i).+?\(0,\i\.\i\)\(\i,\i,\{volume:)\1(?=\}\))/, replace: "$&>200?200:$&" }, { diff --git a/src/plugins/whoReacted/index.tsx b/src/plugins/whoReacted/index.tsx index e28e6aa03..d4f456185 100644 --- a/src/plugins/whoReacted/index.tsx +++ b/src/plugins/whoReacted/index.tsx @@ -103,8 +103,8 @@ export default definePlugin({ { find: '"MessageReactionsStore"', replacement: { - match: /function (\i)\(\){(\i)={}(?=.*CONNECTION_OPEN:\1)/, - replace: "$&;$self.reactions=$2;" + match: /CONNECTION_OPEN:function\(\){(\i)={}/, + replace: "$&;$self.reactions=$1;" } }, {