From ec34412100e226f85d7414651bf99b0fffdba972 Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Thu, 28 Mar 2024 09:48:47 -0300 Subject: [PATCH 1/8] Fix store finds --- src/plugins/alwaysTrust/index.ts | 2 +- src/plugins/ignoreActivities/index.tsx | 2 +- src/plugins/noBlockedMessages/index.ts | 4 ++-- src/plugins/showHiddenChannels/index.tsx | 6 +++--- src/plugins/spotifyCrack/index.ts | 2 +- src/plugins/volumeBooster.discordDesktop/index.ts | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/plugins/alwaysTrust/index.ts b/src/plugins/alwaysTrust/index.ts index 5113935f4..b195e8ebf 100644 --- a/src/plugins/alwaysTrust/index.ts +++ b/src/plugins/alwaysTrust/index.ts @@ -41,7 +41,7 @@ export default definePlugin({ authors: [Devs.zt, Devs.Trwy], patches: [ { - find: ".displayName=\"MaskedLinkStore\"", + find: '="MaskedLinkStore",', replacement: { match: /(?<=isTrustedDomain\(\i\){)return \i\(\i\)/, replace: "return true" diff --git a/src/plugins/ignoreActivities/index.tsx b/src/plugins/ignoreActivities/index.tsx index c04ce1c56..5c349a4e7 100644 --- a/src/plugins/ignoreActivities/index.tsx +++ b/src/plugins/ignoreActivities/index.tsx @@ -210,7 +210,7 @@ export default definePlugin({ patches: [ { - find: '.displayName="LocalActivityStore"', + find: '="LocalActivityStore",', replacement: [ { match: /HANG_STATUS.+?(?=!\i\(\i,\i\)&&)(?<=(\i)\.push.+?)/, diff --git a/src/plugins/noBlockedMessages/index.ts b/src/plugins/noBlockedMessages/index.ts index f9de3e13c..8435f1351 100644 --- a/src/plugins/noBlockedMessages/index.ts +++ b/src/plugins/noBlockedMessages/index.ts @@ -38,8 +38,8 @@ export default definePlugin({ ] }, ...[ - 'displayName="MessageStore"', - 'displayName="ReadStateStore"' + '="MessageStore",', + '="ReadStateStore",' ].map(find => ({ find, predicate: () => Settings.plugins.NoBlockedMessages.ignoreBlockedMessages === true, diff --git a/src/plugins/showHiddenChannels/index.tsx b/src/plugins/showHiddenChannels/index.tsx index 2d091c24a..9968ef16b 100644 --- a/src/plugins/showHiddenChannels/index.tsx +++ b/src/plugins/showHiddenChannels/index.tsx @@ -191,7 +191,7 @@ export default definePlugin({ }, { // Hide the new version of unreads box for hidden channels - find: '.displayName="ChannelListUnreadsStore"', + find: '="ChannelListUnreadsStore",', replacement: { match: /(?<=if\(null==(\i))(?=.{0,160}?getHasImportantUnread\)\(\i\))/g, // Global because Discord has multiple methods like that in the same module replace: (_, channel) => `||$self.isHiddenChannel(${channel})` @@ -442,7 +442,7 @@ export default definePlugin({ } }, { - find: '.displayName="GuildChannelStore"', + find: '="GuildChannelStore",', replacement: [ { // Make GuildChannelStore contain hidden channels @@ -465,7 +465,7 @@ export default definePlugin({ } }, { - find: '.displayName="NowPlayingViewStore"', + find: '="NowPlayingViewStore",', replacement: { // Make active now voice states on hidden channels match: /(getVoiceStateForUser.{0,150}?)&&\i\.\i\.canWithPartialContext.{0,20}VIEW_CHANNEL.+?}\)(?=\?)/, diff --git a/src/plugins/spotifyCrack/index.ts b/src/plugins/spotifyCrack/index.ts index 5d890349c..1beccad60 100644 --- a/src/plugins/spotifyCrack/index.ts +++ b/src/plugins/spotifyCrack/index.ts @@ -51,7 +51,7 @@ export default definePlugin({ }, }, { - find: '.displayName="SpotifyStore"', + find: '"displayName","SpotifyStore")', replacement: [ { predicate: () => settings.store.noSpotifyAutoPause, diff --git a/src/plugins/volumeBooster.discordDesktop/index.ts b/src/plugins/volumeBooster.discordDesktop/index.ts index 4aca79fc7..b455c97ec 100644 --- a/src/plugins/volumeBooster.discordDesktop/index.ts +++ b/src/plugins/volumeBooster.discordDesktop/index.ts @@ -71,7 +71,7 @@ export default definePlugin({ }, // Prevent the MediaEngineStore from overwriting our LocalVolumes above 200 with the ones the Discord Audio Context Settings sync sends { - find: '.displayName="MediaEngineStore"', + find: '="MediaEngineStore",', replacement: [ { match: /(\.settings\.audioContextSettings.+?)(\i\[\i\])=(\i\.volume)(.+?setLocalVolume\(\i,).+?\)/, From 344f8c9f0384a60061d62843c9a144e9e00633eb Mon Sep 17 00:00:00 2001 From: TheKodeToad Date: Thu, 28 Mar 2024 11:31:08 +0000 Subject: [PATCH 2/8] Fix DisableCallIdle --- src/plugins/disableCallIdle/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/disableCallIdle/index.ts b/src/plugins/disableCallIdle/index.ts index 904d53b03..d26f72813 100644 --- a/src/plugins/disableCallIdle/index.ts +++ b/src/plugins/disableCallIdle/index.ts @@ -29,7 +29,7 @@ export default definePlugin({ { find: ".Messages.BOT_CALL_IDLE_DISCONNECT", replacement: { - match: /,?(?=this\.idleTimeout=new \i\.Timeout)/, + match: /,?(?=\i\(this,"idleTimeout",new \i\.Timeout\))/, replace: ";return;" } }, From 2f07dc230a8ae5d52e72d66aa7cd68e6e4f4157e Mon Sep 17 00:00:00 2001 From: AutumnVN Date: Thu, 28 Mar 2024 19:40:48 +0700 Subject: [PATCH 3/8] fix BetterGifPicker, Experiments --- src/plugins/betterGifPicker/index.ts | 4 ++-- src/plugins/experiments/index.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/betterGifPicker/index.ts b/src/plugins/betterGifPicker/index.ts index 09bb570d7..f1608f28c 100644 --- a/src/plugins/betterGifPicker/index.ts +++ b/src/plugins/betterGifPicker/index.ts @@ -15,8 +15,8 @@ export default definePlugin({ { find: ".GIFPickerResultTypes.SEARCH", replacement: [{ - match: "this.state={resultType:null}", - replace: 'this.state={resultType:"Favorites"}' + match: /(?<="state",{resultType:)null/, + replace: '"Favorites"' }] } ] diff --git a/src/plugins/experiments/index.tsx b/src/plugins/experiments/index.tsx index f8ea4b04a..344638828 100644 --- a/src/plugins/experiments/index.tsx +++ b/src/plugins/experiments/index.tsx @@ -64,7 +64,7 @@ export default definePlugin({ } }, { - find: ".isStaff=()", + find: '"isStaff",', predicate: () => settings.store.enableIsStaff, replacement: [ { From 74c38146d5f186b242d6fc51c6287a472ba5576b Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Thu, 28 Mar 2024 10:17:05 -0300 Subject: [PATCH 4/8] Fix BetterSettings patches (#2307) --- src/plugins/betterSettings/index.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/betterSettings/index.tsx b/src/plugins/betterSettings/index.tsx index 6d3c8798e..7d81c6f5c 100644 --- a/src/plugins/betterSettings/index.tsx +++ b/src/plugins/betterSettings/index.tsx @@ -82,7 +82,7 @@ export default definePlugin({ find: "this.renderArtisanalHack()", replacement: [ { // Fade in on layer - match: /(?<=(\i)\.contextType=\i\.AccessibilityPreferencesContext;)/, + match: /(?<=\((\i),"contextType",\i\.AccessibilityPreferencesContext\);)/, replace: "$1=$self.Layer;", predicate: () => settings.store.disableFade }, @@ -107,11 +107,11 @@ export default definePlugin({ ], predicate: () => settings.store.disableFade }, - { // Load menu stuff on hover, not on click + { // Load menu TOC eagerly find: "Messages.USER_SETTINGS_WITH_BUILD_OVERRIDE.format", replacement: { - match: /(?<=handleOpenSettingsContextMenu.{0,250}?\i\.el\(("[^"]+")\)\.then\([^;]*?("\d+").*?Messages\.USER_SETTINGS,)(?=onClick:)/, - replace: "onMouseEnter(){Vencord.Webpack.wreq.el($1).then(()=>Vencord.Webpack.wreq($2));}," + match: /(?<=(\i)\(this,"handleOpenSettingsContextMenu",.{0,100}?openContextMenuLazy.{0,100}?(await Promise\.all[^};]*?\)\)).*?,)(?=\1\(this)/, + replace: "(async ()=>$2)()," }, predicate: () => settings.store.eagerLoad }, From 762684a138f19308a3e64d6578aae57f453cae5f Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Thu, 28 Mar 2024 10:30:29 -0300 Subject: [PATCH 5/8] Fix more patches --- src/plugins/betterGifAltText/index.ts | 2 +- src/plugins/decor/index.tsx | 4 ++-- src/plugins/gifPaste/index.ts | 6 +++--- src/plugins/ignoreActivities/index.tsx | 2 +- src/plugins/noBlockedMessages/index.ts | 2 +- src/plugins/resurrectHome/index.tsx | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/plugins/betterGifAltText/index.ts b/src/plugins/betterGifAltText/index.ts index 8b4116318..f0090343e 100644 --- a/src/plugins/betterGifAltText/index.ts +++ b/src/plugins/betterGifAltText/index.ts @@ -26,7 +26,7 @@ export default definePlugin({ "Change GIF alt text from simply being 'GIF' to containing the gif tags / filename", patches: [ { - find: "onCloseImage=", + find: '"onCloseImage",', replacement: { match: /(return.{0,10}\.jsx.{0,50}isWindowFocused)/, replace: diff --git a/src/plugins/decor/index.tsx b/src/plugins/decor/index.tsx index 7b9b4e3bf..d4f420c7d 100644 --- a/src/plugins/decor/index.tsx +++ b/src/plugins/decor/index.tsx @@ -61,8 +61,8 @@ export default definePlugin({ }, // Remove NEW label from decor avatar decorations { - match: /(?<=\.Section\.PREMIUM_PURCHASE&&\i;if\()(?<=avatarDecoration:(\i).+?)/, - replace: "$1.skuId===$self.SKU_ID||" + match: /(?<=\.Section\.PREMIUM_PURCHASE&&\i)(?<=avatarDecoration:(\i).+?)/, + replace: "||$1.skuId===$self.SKU_ID" } ] }, diff --git a/src/plugins/gifPaste/index.ts b/src/plugins/gifPaste/index.ts index 3e864b31a..5553bf847 100644 --- a/src/plugins/gifPaste/index.ts +++ b/src/plugins/gifPaste/index.ts @@ -29,10 +29,10 @@ export default definePlugin({ authors: [Devs.Ven], patches: [{ - find: ".handleSelectGIF=", + find: '"handleSelectGIF",', replacement: { - match: /\.handleSelectGIF=(\i)=>\{/, - replace: ".handleSelectGIF=$1=>{if (!this.props.className) return $self.handleSelect($1);" + match: /"handleSelectGIF",(\i)=>\{/, + replace: '"handleSelectGIF",$1=>{if (!this.props.className) return $self.handleSelect($1);' } }], diff --git a/src/plugins/ignoreActivities/index.tsx b/src/plugins/ignoreActivities/index.tsx index 5c349a4e7..e2262129d 100644 --- a/src/plugins/ignoreActivities/index.tsx +++ b/src/plugins/ignoreActivities/index.tsx @@ -213,7 +213,7 @@ export default definePlugin({ find: '="LocalActivityStore",', replacement: [ { - match: /HANG_STATUS.+?(?=!\i\(\i,\i\)&&)(?<=(\i)\.push.+?)/, + match: /HANG_STATUS.+?(?=!\i\(\)\(\i,\i\)&&)(?<=(\i)\.push.+?)/, replace: (m, activities) => `${m}${activities}=${activities}.filter($self.isActivityNotIgnored);` } ] diff --git a/src/plugins/noBlockedMessages/index.ts b/src/plugins/noBlockedMessages/index.ts index 8435f1351..427f725ca 100644 --- a/src/plugins/noBlockedMessages/index.ts +++ b/src/plugins/noBlockedMessages/index.ts @@ -39,7 +39,7 @@ export default definePlugin({ }, ...[ '="MessageStore",', - '="ReadStateStore",' + '"displayName","ReadStateStore")' ].map(find => ({ find, predicate: () => Settings.plugins.NoBlockedMessages.ignoreBlockedMessages === true, diff --git a/src/plugins/resurrectHome/index.tsx b/src/plugins/resurrectHome/index.tsx index 6b0069a7f..f48debc76 100644 --- a/src/plugins/resurrectHome/index.tsx +++ b/src/plugins/resurrectHome/index.tsx @@ -59,7 +59,7 @@ export default definePlugin({ find: "GuildHomeFeedbackExperiment.definition.id", replacement: [ { - match: /return{showFeedback:\i,setOnDismissedFeedback:(\i)}/, + match: /return{showFeedback:.+?,setOnDismissedFeedback:(\i)}/, replace: "return{showFeedback:false,setOnDismissedFeedback:$1}" } ] From 126023f8f2dca014117d954642e2cd1408cabd6a Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Thu, 28 Mar 2024 10:44:37 -0300 Subject: [PATCH 6/8] ShowHiddenChannels: Fix patches --- src/plugins/showHiddenChannels/index.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/plugins/showHiddenChannels/index.tsx b/src/plugins/showHiddenChannels/index.tsx index 9968ef16b..31dc93ad2 100644 --- a/src/plugins/showHiddenChannels/index.tsx +++ b/src/plugins/showHiddenChannels/index.tsx @@ -138,7 +138,7 @@ export default definePlugin({ all: true, // Render null instead of the buttons if the channel is hidden replacement: { - match: /(?<=renderOpenChatButton=\(\)=>{)/, + match: /(?<="renderOpenChatButton",\(\)=>{)/, replace: "if($self.isHiddenChannel(this.props.channel))return null;" } }, @@ -193,8 +193,8 @@ export default definePlugin({ // Hide the new version of unreads box for hidden channels find: '="ChannelListUnreadsStore",', replacement: { - match: /(?<=if\(null==(\i))(?=.{0,160}?getHasImportantUnread\)\(\i\))/g, // Global because Discord has multiple methods like that in the same module - replace: (_, channel) => `||$self.isHiddenChannel(${channel})` + match: /(?=&&\(0,\i\.getHasImportantUnread\)\((\i)\))/g, // Global because Discord has multiple methods like that in the same module + replace: (_, channel) => `&&!$self.isHiddenChannel(${channel})` } }, { @@ -218,19 +218,19 @@ export default definePlugin({ find: "Missing channel in Channel.renderHeaderToolbar", replacement: [ { - match: /(?<=renderHeaderToolbar=\(\)=>{.+?case \i\.\i\.GUILD_TEXT:)(?=.+?(\i\.push.{0,50}channel:(\i)},"notifications"\)\)))(?<=isLurking:(\i).+?)/, + match: /(?<="renderHeaderToolbar",\(\)=>{.+?case \i\.\i\.GUILD_TEXT:)(?=.+?(\i\.push.{0,50}channel:(\i)},"notifications"\)\)))(?<=isLurking:(\i).+?)/, replace: (_, pushNotificationButtonExpression, channel, isLurking) => `if(!${isLurking}&&$self.isHiddenChannel(${channel})){${pushNotificationButtonExpression};break;}` }, { - match: /(?<=renderHeaderToolbar=\(\)=>{.+?case \i\.\i\.GUILD_MEDIA:)(?=.+?(\i\.push.{0,40}channel:(\i)},"notifications"\)\)))(?<=isLurking:(\i).+?)/, + match: /(?<="renderHeaderToolbar",\(\)=>{.+?case \i\.\i\.GUILD_MEDIA:)(?=.+?(\i\.push.{0,40}channel:(\i)},"notifications"\)\)))(?<=isLurking:(\i).+?)/, replace: (_, pushNotificationButtonExpression, channel, isLurking) => `if(!${isLurking}&&$self.isHiddenChannel(${channel})){${pushNotificationButtonExpression};break;}` }, { - match: /renderMobileToolbar=\(\)=>{.+?case \i\.\i\.GUILD_DIRECTORY:(?<=let{channel:(\i).+?)/, + match: /"renderMobileToolbar",\(\)=>{.+?case \i\.\i\.GUILD_DIRECTORY:(?<=let{channel:(\i).+?)/, replace: (m, channel) => `${m}if($self.isHiddenChannel(${channel}))break;` }, { - match: /(?<=renderHeaderBar=\(\)=>{.+?hideSearch:(\i)\.isDirectory\(\))/, + match: /(?<="renderHeaderBar",\(\)=>{.+?hideSearch:(\i)\.isDirectory\(\))/, replace: (_, channel) => `||$self.isHiddenChannel(${channel})` }, { From 7fe718a018fa7ec1ddb16b002ab3495ea6ba0c29 Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Thu, 28 Mar 2024 11:30:04 -0300 Subject: [PATCH 7/8] FakeNitro: Make Soundboard sounds not require boost level --- src/plugins/fakeNitro/index.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/plugins/fakeNitro/index.tsx b/src/plugins/fakeNitro/index.tsx index d6028aa76..eb9931956 100644 --- a/src/plugins/fakeNitro/index.tsx +++ b/src/plugins/fakeNitro/index.tsx @@ -388,6 +388,14 @@ export default definePlugin({ match: /\i\.\i\.isPremium\(\i\.\i\.getCurrentUser\(\)\)/, replace: "true" } + }, + // Make all Soundboard sounds available + { + find: 'type:"GUILD_SOUNDBOARD_SOUND_CREATE"', + replacement: { + match: /(?<=type:"(?:SOUNDBOARD_SOUNDS_RECEIVED|GUILD_SOUNDBOARD_SOUND_CREATE|GUILD_SOUNDBOARD_SOUND_UPDATE|GUILD_SOUNDBOARD_SOUNDS_UPDATE)".+?available:)\i\.available/g, + replace: "true" + } } ], From bdef47eb8aee5cc53f09683e7847eca8bc1b722b Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Thu, 28 Mar 2024 11:44:38 -0300 Subject: [PATCH 8/8] Bump to 1.7.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 025fa13d4..78370f097 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vencord", "private": "true", - "version": "1.7.3", + "version": "1.7.4", "description": "The cutest Discord client mod", "homepage": "https://github.com/Vendicated/Vencord#readme", "bugs": {