diff --git a/src/equicordplugins/_api/audioPlayer.ts b/src/equicordplugins/_api/audioPlayer.ts index 615eb93e4..e79227b39 100644 --- a/src/equicordplugins/_api/audioPlayer.ts +++ b/src/equicordplugins/_api/audioPlayer.ts @@ -24,7 +24,7 @@ export default definePlugin({ // Uses the audio as-is if external, otherwise checks for an internal Discord sound. // Also force loads the internal sounds module to account for the second patch group below, // as well as accounting for not calling the module in this patch when this.type is not DISCORD. - match: /(let \i=class.{0,900}?new Audio;\i.src=)((\i\(\d+\)).{0,50}concat\()this.name(,".mp3"\)\))/, + match: /(let \i=class.{0,900}?new Audio;\i.src=)((\i\(\d+\))(?:\(`\.\/\$\{|.{0,50}concat\())this.name((?:\}\.mp3`|,".mp3"\))\))/, replace: "$3;$1this.type!==$self.AudioType.DISCORD?this.audio:$2this.audio$4" }, { diff --git a/src/equicordplugins/_api/headerBar.ts b/src/equicordplugins/_api/headerBar.ts index 134a3b7aa..8f7edc595 100644 --- a/src/equicordplugins/_api/headerBar.ts +++ b/src/equicordplugins/_api/headerBar.ts @@ -4,13 +4,13 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import { EquicordDevs } from "@utils/constants"; +import { Devs } from "@utils/constants"; import definePlugin from "@utils/types"; export default definePlugin({ name: "HeaderBarAPI", description: "API to add buttons to the header bar and channel toolbar.", - authors: [EquicordDevs.prism], + authors: [Devs.prism], patches: [ { @@ -23,7 +23,7 @@ export default definePlugin({ { find: "Missing channel in Channel.renderHeaderToolbar", replacement: { - match: /(?<=renderHeaderToolbar",\(\)=>\{.{1,200}let (\i)=\[\];)/, + match: /(?<=renderHeaderToolbar"\);let (\i)=\[\];)/, replace: "Vencord.Api.HeaderBar._addChannelToolbarButtons($1);" } } diff --git a/src/equicordplugins/_api/userArea.ts b/src/equicordplugins/_api/userArea.ts index 251b06243..c273015d4 100644 --- a/src/equicordplugins/_api/userArea.ts +++ b/src/equicordplugins/_api/userArea.ts @@ -6,7 +6,7 @@ import { isPluginEnabled } from "@api/PluginManager"; import betterUserArea from "@equicordplugins/betterUserArea"; -import { EquicordDevs } from "@utils/constants"; +import { Devs } from "@utils/constants"; import definePlugin from "@utils/types"; import { findCssClassesLazy } from "@webpack"; @@ -15,7 +15,7 @@ const { iconForeground } = findCssClassesLazy("iconForeground", "autocompleteRow export default definePlugin({ name: "UserAreaAPI", description: "API to add buttons to the user area panel.", - authors: [EquicordDevs.prism], + authors: [Devs.prism], patches: [ { diff --git a/src/equicordplugins/bannersEverywhere/index.tsx b/src/equicordplugins/bannersEverywhere/index.tsx index 3023ce951..5959a4022 100644 --- a/src/equicordplugins/bannersEverywhere/index.tsx +++ b/src/equicordplugins/bannersEverywhere/index.tsx @@ -65,8 +65,8 @@ export default definePlugin({ find: "role:\"listitem\",innerRef", replacement: { // We cant access the user id here, so we take the banner property we set earlier - match: /focusProps.\i\}=(\i).*?children:\[/, - replace: "$&$1.banner," + match: /children:\[(?=.{0,100}\.MEMBER_LIST)/, + replace: "$&arguments[0].banner," } } ], diff --git a/src/equicordplugins/betterActivities/index.tsx b/src/equicordplugins/betterActivities/index.tsx index 79e3e55e9..f5c35f122 100644 --- a/src/equicordplugins/betterActivities/index.tsx +++ b/src/equicordplugins/betterActivities/index.tsx @@ -27,20 +27,19 @@ export default definePlugin({ patches: [ { // Patch activity icons - find: "isBlockedOrIgnored(null", + find: '"ActivityStatus"),', replacement: [ { - match: /(?<=className:\i,children:\[).*?(?=\i\(\),\i&&)/, + match: /(?<=className:\i,children:\[).*?(?=\i\(\),\i&&)/g, replace: "", predicate: () => settings.store.removeGameActivityStatus, }, { - match: /(?<=hideTooltip:.{0,4}}=(\i).*?{}\))\]/, + match: /(?<=hideTooltip:.{0,4}}=(\i).*?{}\))\]/g, replace: ",$self.patchActivityList($1)]", predicate: () => settings.store.memberList, } ], - all: true }, { // Show all activities in the user popout/sidebar diff --git a/src/equicordplugins/betterInvites/index.tsx b/src/equicordplugins/betterInvites/index.tsx index a33463dac..550e4fd25 100644 --- a/src/equicordplugins/betterInvites/index.tsx +++ b/src/equicordplugins/betterInvites/index.tsx @@ -33,7 +33,7 @@ function lurk(id: string) { export default definePlugin({ name: "BetterInvites", - description: "See invites expiration date, view inviter profile and preview discoverable servers before joining by clicking their name", + description: "See invites expiration date, view inviter profile and preview servers before joining by clicking the name", authors: [EquicordDevs.iamme, Devs.thororen], patches: [ { diff --git a/src/equicordplugins/betterUserArea/index.ts b/src/equicordplugins/betterUserArea/index.ts index 22d36b745..fdde42738 100644 --- a/src/equicordplugins/betterUserArea/index.ts +++ b/src/equicordplugins/betterUserArea/index.ts @@ -5,7 +5,7 @@ */ import { definePluginSettings } from "@api/Settings"; -import { EquicordDevs } from "@utils/constants"; +import { Devs } from "@utils/constants"; import definePlugin, { OptionType } from "@utils/types"; const settings = definePluginSettings({ @@ -50,7 +50,7 @@ const settings = definePluginSettings({ export default definePlugin({ name: "BetterUserArea", description: "Customize and make the user area more clean.", - authors: [EquicordDevs.prism], + authors: [Devs.prism], settings, patches: [ { diff --git a/src/equicordplugins/blockKeywords/index.ts b/src/equicordplugins/blockKeywords/index.ts index df585f679..3f7504373 100644 --- a/src/equicordplugins/blockKeywords/index.ts +++ b/src/equicordplugins/blockKeywords/index.ts @@ -73,10 +73,10 @@ export default definePlugin({ authors: [EquicordDevs.catcraft], patches: [ { - find: '"_channelMessages",{})', + find: "_channelMessages={}", predicate: () => settings.store.blockedWords !== "", replacement: { - match: /static commit\((.{1,2})\){/g, + match: /static commit\((\i)\)\{/g, replace: "$&$1=$self.blockMessagesWithKeywords($1);" } }, diff --git a/src/equicordplugins/channelTabs/index.tsx b/src/equicordplugins/channelTabs/index.tsx index 330adc80e..35e6888a3 100644 --- a/src/equicordplugins/channelTabs/index.tsx +++ b/src/equicordplugins/channelTabs/index.tsx @@ -61,12 +61,12 @@ export default definePlugin({ find: '"AppView"', replacement: [ { - match: /(\?void 0:(\i)\.channelId.{0,600})"div",{(?=className:\i\.\i)/, + match: /((\i\?.params)\?\.channelId.{0,600})"div",{(?=className:\i\.\i)/, replace: "$1$self.render,{currentChannel:$2,", predicate: () => settings.store.tabBarPosition === "top" }, { - match: /(\?void 0:(\i)\.channelId.{0,300})"div",{/, + match: /((\i\?.params)\?.channelId.{0,300})"div",{/, replace: "$1$self.render,{currentChannel:$2,", predicate: () => settings.store.tabBarPosition === "bottom" } @@ -74,9 +74,9 @@ export default definePlugin({ }, // intercept channel navigation to switch/create tabs { - find: '"transitionToGuild - Transitioning to "', + find: "`transitionToGuild - Transitioning to", replacement: { - match: /(\i\((\i),(\i),\i,\i\)\{)(.{0,25}"transitionToGuild)/, + match: /(\i\((\i),(\i),\i,\i\)\{)(.{0,25}`transitionToGuild)/, replace: "$1$self.handleNavigation($2,$3);$4" } }, @@ -106,7 +106,7 @@ export default definePlugin({ }, // prevent issues with the pins/inbox popouts being too tall { - find: "renderCloseButton()", + find: "#{intl::JUMP}),onClick:", replacement: { match: /\i&&\((\i).maxHeight.{0,5}\)/, replace: "$&;$1.maxHeight-=$self.containerHeight" diff --git a/src/equicordplugins/cleanerChannelGroups/index.ts b/src/equicordplugins/cleanerChannelGroups/index.ts new file mode 100644 index 000000000..73f5ba4ce --- /dev/null +++ b/src/equicordplugins/cleanerChannelGroups/index.ts @@ -0,0 +1,29 @@ +/* + * Vencord, a Discord client mod + * Copyright (c) 2026 Vendicated and contributors + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +import { EquicordDevs } from "@utils/constants"; +import definePlugin from "@utils/types"; + +export default definePlugin({ + name: "CleanerChannelGroups", + description: "Hides all channels in collapsed categories, even if they have unread messages.", + authors: [EquicordDevs.justjxke], + patches: [ + { + find: '"placeholder-channel-id"', + replacement: [ + { + match: /this\.category\.isCollapsed&&\(.{0,600}?\)\?\{renderLevel:3,threadIds:/, + replace: "this.category.isCollapsed?{renderLevel:3,threadIds:" + }, + { + match: /(?<=!this.category.isCollapsed.{0,50}\i=)(\i\(this\.record,.{0,5},\i\.hideMutedChannels\);)/, + replace: "this.category.isCollapsed?[]:$1" + } + ] + } + ] +}); diff --git a/src/equicordplugins/clientSideBlock/index.tsx b/src/equicordplugins/clientSideBlock/index.tsx index dd9a750c4..80049e0c9 100644 --- a/src/equicordplugins/clientSideBlock/index.tsx +++ b/src/equicordplugins/clientSideBlock/index.tsx @@ -217,7 +217,7 @@ export default definePlugin({ { find: "getFriendIDs(){", replacement: { - match: /return \i\.friends/, + match: /\?\?\[\]\)\),\i\.friends/, replace: "$&.filter(id => !$self.shouldHideUser(id))" } }, diff --git a/src/equicordplugins/components.dev/index.tsx b/src/equicordplugins/components.dev/index.tsx index 78d6a3c4a..4506cb656 100644 --- a/src/equicordplugins/components.dev/index.tsx +++ b/src/equicordplugins/components.dev/index.tsx @@ -7,7 +7,7 @@ import "./styles.css"; import SettingsPlugin, { settingsSectionMap } from "@plugins/_core/settings"; -import { EquicordDevs } from "@utils/constants"; +import { Devs } from "@utils/constants"; import definePlugin, { StartAt } from "@utils/types"; import { openUserSettingsPanel } from "@webpack/common"; @@ -40,7 +40,7 @@ function ComponentsIcon(props: React.SVGProps) { export default definePlugin({ name: "Components", description: "Adds a new tab to settings to browse Discord components.", - authors: [EquicordDevs.prism], + authors: [Devs.prism], dependencies: ["Settings"], startAt: StartAt.WebpackReady, toolboxActions: { diff --git a/src/equicordplugins/customUserColors/index.tsx b/src/equicordplugins/customUserColors/index.tsx index f13221363..5244197e3 100644 --- a/src/equicordplugins/customUserColors/index.tsx +++ b/src/equicordplugins/customUserColors/index.tsx @@ -26,7 +26,7 @@ export let colors: Record = {}; })(); // needed for color picker to be available without opening settings (ty pindms!!) -const requireSettingsMenu = extractAndLoadChunksLazy(['name:"UserSettings"'], /createPromise:.{0,20}(\i\.\i\("?.+?"?\).*?).then\(\i\.bind\(\i,"?(.+?)"?\)\).{0,50}"UserSettings"/); +const requireSettingsMenu = extractAndLoadChunksLazy(['"AppSkeleton"'], /createPromise:.{0,20}(\i\.\i\("?.+?"?\).*?).then\(\i\.bind\(\i,"?(.+?)"?\)\).{0,50}\}\),(?=.{0,15}createPromise.*?\}\),)/); const ColorIcon = () => { return ( settings.store.noMirroredCamera, replacement: { match: /mirror:\i/, @@ -115,7 +115,7 @@ export default definePlugin({ }, }, { - find: ".buttons.length)>=1", + find: ".USER_PROFILE_ACTIVITY_BUTTONS),", predicate: () => settings.store.showYourOwnActivityButtons && !isPluginEnabled(customRPC.name), replacement: { match: /.getId\(\)===\i.id/, diff --git a/src/equicordplugins/exitSounds/index.tsx b/src/equicordplugins/exitSounds/index.tsx index 11052f304..3f161fbb6 100644 --- a/src/equicordplugins/exitSounds/index.tsx +++ b/src/equicordplugins/exitSounds/index.tsx @@ -10,7 +10,7 @@ import { playAudio } from "@api/AudioPlayer"; import { NavContextMenuPatchCallback } from "@api/ContextMenu"; import { definePluginSettings } from "@api/Settings"; import { Button } from "@components/Button"; -import { EquicordDevs } from "@utils/constants"; +import { Devs } from "@utils/constants"; import { classNameFactory } from "@utils/css"; import definePlugin, { OptionType } from "@utils/types"; import { findComponentByCodeLazy } from "@webpack"; @@ -104,7 +104,7 @@ let original: typeof ChannelActions.selectVoiceChannel; export default definePlugin({ name: "ExitSounds", description: "Play soundboard sounds when you disconnect from voice.", - authors: [EquicordDevs.prism], + authors: [Devs.prism], dependencies: ["AudioPlayerAPI"], settings, diff --git a/src/equicordplugins/favouriteAnything/index.tsx b/src/equicordplugins/favouriteAnything/index.tsx index 6025a66fa..8780f309e 100644 --- a/src/equicordplugins/favouriteAnything/index.tsx +++ b/src/equicordplugins/favouriteAnything/index.tsx @@ -93,9 +93,9 @@ export default definePlugin({ }, // Add a proxyUrl prop alongside the src prop, which is used for video thumbnails. { - find: '"renderOverlayContent","renderLinkComponent"', + find: /disableArrowKeySeek:\i\}\)\}/, replacement: { - match: /src:\i(?=\})/, + match: /src:\i(?=,\.\.\.\i)/, replace: "$&,proxyUrl:this.props.src" } } diff --git a/src/equicordplugins/ghosted/GhostedUsersModal.tsx b/src/equicordplugins/ghosted/GhostedUsersModal.tsx index 4316fe088..7b78e562a 100644 --- a/src/equicordplugins/ghosted/GhostedUsersModal.tsx +++ b/src/equicordplugins/ghosted/GhostedUsersModal.tsx @@ -20,7 +20,7 @@ function formatMessageDate(timestamp: string | Date): string { return `${month}/${day}/${year}`; } -const GroupDmsRecipientsIcon = findComponentByCodeLazy("\"recipients\",\"size\","); +const GroupDmsRecipientsIcon = findComponentByCodeLazy('["aria-hidden"],"aria-label":'); const SelectedChannelActionCreators = findByPropsLazy("selectPrivateChannel"); function GroupDmsIcon({ channel }: { channel: Channel; }) { diff --git a/src/equicordplugins/githubRepos/index.tsx b/src/equicordplugins/githubRepos/index.tsx index 5ec1aafc9..c621e4991 100644 --- a/src/equicordplugins/githubRepos/index.tsx +++ b/src/equicordplugins/githubRepos/index.tsx @@ -86,7 +86,7 @@ export default definePlugin({ patches: [ // User Popout { - find: ".hasAvatarForGuild(null==", + find: /onOpenUserProfileModal:\i\}\),\i/, replacement: { match: /userId:\i\.id,guild:\i.{0,15}\}\).{0,100}(?=\])/, replace: "$&,$self.ProfilePopoutComponent(arguments[0])" diff --git a/src/equicordplugins/ignoreCalls/index.tsx b/src/equicordplugins/ignoreCalls/index.tsx index 64783eb75..952fb4273 100644 --- a/src/equicordplugins/ignoreCalls/index.tsx +++ b/src/equicordplugins/ignoreCalls/index.tsx @@ -89,7 +89,7 @@ export default definePlugin({ { find: "#{intl::INCOMING_CALL_ELLIPSIS}", replacement: { - match: /\(\i\)\)\),className:\i\.\i\}\)/, + match: /(?<=onCallJoined:\(\).{0,150})\(\i\)\}\),className:\i\.\i\}\)/, replace: "$&,$self.renderIgnore(arguments[0].channel)" } } diff --git a/src/equicordplugins/inviteDefaults/index.ts b/src/equicordplugins/inviteDefaults/index.ts index 288622324..597c96fec 100644 --- a/src/equicordplugins/inviteDefaults/index.ts +++ b/src/equicordplugins/inviteDefaults/index.ts @@ -52,7 +52,7 @@ export default definePlugin({ find: ".GUILD_CREATE_INVITE_SUGGESTION,defaultMaxAge", replacement: [ { - match: /(?<=maxAge:)null!=\(\i=null!=\i\?\i:\i\)\?\i:\i.\i/, + match: /(?<=maxAge:)\i\?\?\i\?\?\i\.\i/, replace: "$self.settings.store.inviteDuration" }, { @@ -60,7 +60,7 @@ export default definePlugin({ replace: "$self.settings.store.maxUses" }, { - match: /(?<=temporary:)null!=\i&&\i/, + match: /(?<=temporary:)\i\?\?!1/, replace: "$self.settings.store.temporaryMembership" } ] diff --git a/src/equicordplugins/limitMiddleClickPaste/index.ts b/src/equicordplugins/limitMiddleClickPaste/index.ts index 9219244ff..632eae2fe 100644 --- a/src/equicordplugins/limitMiddleClickPaste/index.ts +++ b/src/equicordplugins/limitMiddleClickPaste/index.ts @@ -113,7 +113,7 @@ export default definePlugin({ // Detects paste events triggered inside of Discord's text input. find: ",origin:\"clipboard\"});", replacement: { - match: /(?<="handlePaste",(\i)=>{)(?=var)/, + match: /(?<=handlePaste=(\i)=>{)(?=let)/, replace: "if($self.isPastingDisabled(true)){$1.preventDefault?.();$1.stopPropagation?.();return;}" } }, diff --git a/src/equicordplugins/messageColors/index.tsx b/src/equicordplugins/messageColors/index.tsx index 5d713e488..568718102 100644 --- a/src/equicordplugins/messageColors/index.tsx +++ b/src/equicordplugins/messageColors/index.tsx @@ -42,12 +42,9 @@ export default definePlugin({ // Changes text md rule regex, so it stops right before hsl( | rgb( // Without it discord will try to pass a string without those to color rule { - find: ".defaultRules.text)", - group: true, + find: ".defaultRules.text,match", replacement: { - // $)/) match: /\$\)\//, - // hsl(|rgb(|$& replace: requiredFirstCharacters.join("|") + "|$&" } }, diff --git a/src/equicordplugins/messageLoggerEnhanced/index.tsx b/src/equicordplugins/messageLoggerEnhanced/index.tsx index addcd7c19..fbed60174 100644 --- a/src/equicordplugins/messageLoggerEnhanced/index.tsx +++ b/src/equicordplugins/messageLoggerEnhanced/index.tsx @@ -261,7 +261,7 @@ export default definePlugin({ ] }, { - find: "THREAD_STARTER_MESSAGE?null==", + find: ".PREMIUM_REFERRAL&&(", replacement: { match: /deleted:\i\.deleted, editHistory:\i\.editHistory,/, replace: "deleted:$self.getDeleted(...arguments), editHistory:$self.getEdited(...arguments)," diff --git a/src/equicordplugins/moreStickers/index.tsx b/src/equicordplugins/moreStickers/index.tsx index 7495a10df..19a9b104b 100644 --- a/src/equicordplugins/moreStickers/index.tsx +++ b/src/equicordplugins/moreStickers/index.tsx @@ -47,10 +47,10 @@ export default definePlugin({ }] }, { - find: ".gifts)", + find: ".GIFT_PROMOTION]).", replacement: [ { - match: /(?<=(,\(null==\(\i=\i\.stickers\)\?void 0.*?\i\.push\(\(.{0,100})\},"sticker"\)\))/, + match: /(?<=(,\i\.stickers\?\.button.{0,50}\i\.push\(\(.{0,100})\},"sticker"\)\))/, replace: "$1,stickersType:\"stickers+\"},\"stickers+\"))" }, ] diff --git a/src/equicordplugins/noModalAnimation/index.ts b/src/equicordplugins/noModalAnimation/index.ts index 17433d8dd..b86bb95b3 100644 --- a/src/equicordplugins/noModalAnimation/index.ts +++ b/src/equicordplugins/noModalAnimation/index.ts @@ -29,8 +29,8 @@ export default definePlugin({ { find: '="ABOVE"', replacement: { - match: /:300/, - replace: ":0", + match: /\?\?300/, + replace: "??0", } }, { diff --git a/src/equicordplugins/notificationTitle.discordDesktop/index.tsx b/src/equicordplugins/notificationTitle.discordDesktop/index.tsx index 7d6e19bce..56d8b3fef 100644 --- a/src/equicordplugins/notificationTitle.discordDesktop/index.tsx +++ b/src/equicordplugins/notificationTitle.discordDesktop/index.tsx @@ -11,7 +11,7 @@ import { findByCodeLazy, findByPropsLazy } from "@webpack"; import { ChannelStore, GuildStore, RelationshipStore, UserStore } from "@webpack/common"; const { getName } = findByPropsLazy("getName", "useName", "getNickname"); -const computeChannelName = findByCodeLazy(".isThread())return'\"'.concat("); +const computeChannelName = findByCodeLazy(".isThread())return`\""); const ChannelTypes = findByPropsLazy("DM", "GUILD_TEXT", "PUBLIC_THREAD", "UNKNOWN"); const ChannelTypesSets = findByPropsLazy("THREADS", "GUILD_TEXTUAL", "ALL_DMS"); diff --git a/src/equicordplugins/profileSets/utils/profile.ts b/src/equicordplugins/profileSets/utils/profile.ts index 765334b53..ecd9f6e54 100644 --- a/src/equicordplugins/profileSets/utils/profile.ts +++ b/src/equicordplugins/profileSets/utils/profile.ts @@ -168,68 +168,77 @@ export async function getCurrentProfile(guildId?: string): Promise q.userStatus?.completedAt).sort((a, b) => { - const aTime = new Date(a.userStatus?.completedAt as string); - const bTime = new Date(b.userStatus?.completedAt as string); - return bTime.getTime() - aTime.getTime(); - }); + const completedUnclaimedQuests = (Array.from(QuestsStore.quests.values()) as Quest[]) + .filter(q => q.userStatus?.completedAt && getQuestStatus(q) === QuestStatus.Unclaimed) + .sort((a, b) => { + const aTime = new Date(a.userStatus?.completedAt as string).getTime(); + const bTime = new Date(b.userStatus?.completedAt as string).getTime(); + return bTime - aTime; + }); - completedQuests.forEach(quest => { - const completedQuest = quest.userStatus?.completedAt; - const questStatus = getQuestStatus(quest); - - if (completedQuest && questStatus === QuestStatus.Unclaimed) { - closestQuest = quest; - } - }); + closestQuest = completedUnclaimedQuests[0] ?? null; } return closestQuest; @@ -1255,11 +1251,11 @@ export default definePlugin({ { // Hides the Quest icon from members list items when // a user is playing a game tied to an active Quest. - find: "),\"activity-\".concat", + find: '"ActivityStatus")', group: true, replacement: [ { - match: /(?<=voiceActivityChannel:\i\?\i:null}\);)/, + match: /(?<=\i\)&&"xs"===\i;)/, replace: "const shouldHideMembersListActivelyPlayingIcon=$self.shouldHideMembersListActivelyPlayingIcon();" }, { @@ -1288,8 +1284,8 @@ export default definePlugin({ // Allows in-progress Quests to still show. find: "QUESTS_BAR,questId", replacement: { - match: /return null==(\i)\?null:\(/, - replace: "return !$self.shouldHideQuestPopup($1)&&(" + match: /(?=if\(null==(\i)\)return null;)(.{0,125}?quest:\i}\);return)/, + replace: "const hidePopup=$self.shouldHideQuestPopup($1);$2!hidePopup&&" } }, { @@ -1312,15 +1308,15 @@ export default definePlugin({ { // Replaces the default displayed Quest with the soonest to // be completed Quest which is actively being auto-completed. - find: "questDeliveryOverride)?", + find: '"useQuestBarQuest"})', replacement: { - match: /(?<=null}\);return )(\i\?\i:\i)/, + match: /(?<=null\);return )(\i\?\i:\i)/, replace: "$self.getQuestPanelOverride()??($1)" } }, { // Hides the Friends List "Active Now" promotion. - find: '"application-stream-"', + find: "`application-stream-", group: true, replacement: [ { @@ -1345,7 +1341,7 @@ export default definePlugin({ }, { // QUESTS_FETCH_QUEST_TO_DELIVER_BEGIN - match: /(?=var.{0,150}QUESTS_FETCH_QUEST_TO_DELIVER_BEGIN)/, + match: /(?=let.{0,150}QUESTS_FETCH_QUEST_TO_DELIVER_BEGIN)/, replace: "if($self.shouldPreventFetchingQuests())return;" } ] @@ -1356,7 +1352,7 @@ export default definePlugin({ // - Also see anywhere DynamicDropdown is used for refactoring. // // Various patches to the SearchableSelect component. - find: '"onSearchChange",', + find: ".popoutLayerContext,renderPopout:", group: true, replacement: [ { @@ -1386,8 +1382,8 @@ export default definePlugin({ }, { // Makes use of the custom popoutClassName prop if provided. - match: /(?<=onKeyDown"]\);return.{0,30}?className:\i\(\)\()/, - replace: "arguments[0]?.popoutClassName," + match: /"aria-busy":!0,className:\i\(\)\(/, + replace: "$&arguments[0]?.popoutClassName," }, { // Passes the custom optionClassName prop to the row renderer. @@ -1411,13 +1407,13 @@ export default definePlugin({ // Formats the Orbs balance on the Quests page with locale string formatting. find: '("BalanceCounter")', replacement: { - match: /(?<=\i=>"".concat\(\i).toFixed\(0\)(?=\)\))/, + match: /(?<=`\$\{\i).toFixed\(0\)(?=\}`)/, replace: ".toLocaleString(undefined,{maximumFractionDigits:0})" } }, { // Adds a maxDigits prop to the LowerBadge component which allows for not truncating, or for truncating at a specific threshold. - find: '"renderBadgeCount"])', + find: ".INTERACTIVE_TEXT_ACTIVE.css,shape", group: true, replacement: [ { @@ -1434,13 +1430,13 @@ export default definePlugin({ // Makes use of the custom prop if provided by using custom logic for negatives and truncation. // If the prop is not provided, assume default behavior for native badges or other plugins not // utilizing the custom prop. - match: /function (\i\((\i))\){return (.{0,100}?k\+"\))/, - replace: "function $1,maxDigits){return maxDigits===undefined?($3):$self.formatLowerBadge($2,maxDigits)[0]" + match: /(?<=function \i\((\i))(\){return )(\i<1e3.{0,60}?k\+`)/, + replace: ",maxDigits$2maxDigits===undefined?($3):$self.formatLowerBadge($1,maxDigits)[0]" } ] }, { - find: "id:\"quest-tile-\".concat", + find: "id:`quest-tile-", group: true, replacement: [ { @@ -1481,7 +1477,7 @@ export default definePlugin({ }, { // Adds the "Questify" sort option to the sort dropdown. - find: '" has no rewards configured"', + find: "has no rewards configured`", replacement: { match: /(?=case (\i.\i).SUGGESTED)/, replace: "case $1.QUESTIFY:return \"Questify\";" @@ -1528,7 +1524,7 @@ export default definePlugin({ }, { // Set the initial filters. - match: /(get\(\i\)\)\)\?\i:)(\i)/, + match: /(get\(\i\)\)\?\?)(\i)/, replace: "$1$self.getLastFilterChoices()??$2" }, { @@ -1616,7 +1612,7 @@ export default definePlugin({ replace: "const questifyText=$self.getQuestUnacceptedButtonText(arguments[0].quest);" }, { - match: /(?<=}\),)(null==\i\|\|\i\(\))/, + match: /(?<=}\),)(\i\?\.\(\))/, replace: "!$self.processQuestForAutoComplete(arguments[0].quest)&&($1)" }, { diff --git a/src/equicordplugins/questify/utils/components.tsx b/src/equicordplugins/questify/utils/components.tsx index afc1a8ceb..1f363a24b 100644 --- a/src/equicordplugins/questify/utils/components.tsx +++ b/src/equicordplugins/questify/utils/components.tsx @@ -14,9 +14,9 @@ import { formatLowerBadge } from "./misc"; // GuildlessServerListItem's built-in pill does not support unread state. export const GuildlessServerListItemComponent = findComponentByCodeLazy("tooltip:", "lowerBadgeSize:"); export const GuildedServerListItemPillComponent = findComponentByCodeLazy('"pill":"empty"'); -export const ServerListItemLowerBadgeComponent = findComponentByCodeLazy("BADGE_NOTIFICATION_BACKGROUND", '"renderBadgeCount"'); +export const ServerListItemLowerBadgeComponent = findComponentByCodeLazy("BADGE_NOTIFICATION_BACKGROUND", "let{count:"); export const ServerListItemUpperBadgeComponent = findComponentByCodeLazy("{icon:", ".ROUND,disableColor"); -export const RadioGroup = findComponentByCodeLazy(',["label","description"'); +export const RadioGroup = findComponentByCodeLazy(",{label:", ",description:", ",required:", ",errorMessage:", ",children:"); export const QuestTile = findComponentByCodeLazy(".rowIndex,trackGuildAndChannelMetadata"); export enum QuestRewardType { diff --git a/src/equicordplugins/quickThemeSwitcher.discordDesktop/index.tsx b/src/equicordplugins/quickThemeSwitcher.discordDesktop/index.tsx index 34d14ebc9..449e35239 100644 --- a/src/equicordplugins/quickThemeSwitcher.discordDesktop/index.tsx +++ b/src/equicordplugins/quickThemeSwitcher.discordDesktop/index.tsx @@ -8,7 +8,7 @@ import { definePluginSettings, Settings, SettingsStore } from "@api/Settings"; import { HeadingSecondary } from "@components/Heading"; import { Paragraph } from "@components/Paragraph"; import { debounce } from "@shared/debounce"; -import { EquicordDevs, IS_MAC } from "@utils/constants"; +import { Devs, IS_MAC } from "@utils/constants"; import definePlugin, { OptionType, StartAt } from "@utils/types"; import { showToast, Toasts } from "@webpack/common"; @@ -244,7 +244,7 @@ const handleThemeNamesChange = () => settings.store.autoRefresh && debouncedRefr export default definePlugin({ name: "QuickThemeSwitcher", description: "Quickly switch between themes using keyboard shortcuts.", - authors: [EquicordDevs.prism], + authors: [Devs.prism], settings, startAt: StartAt.DOMContentLoaded, settingsAboutComponent: () => ( diff --git a/src/equicordplugins/quoter/index.tsx b/src/equicordplugins/quoter/index.tsx index 0644e0e83..f8389de73 100644 --- a/src/equicordplugins/quoter/index.tsx +++ b/src/equicordplugins/quoter/index.tsx @@ -58,7 +58,7 @@ const settings = definePluginSettings({ export default definePlugin({ name: "Quoter", description: "Adds the ability to create an inspirational quote image from a message.", - authors: [Devs.Samwich, Devs.thororen, EquicordDevs.neoarz, EquicordDevs.prism], + authors: [Devs.Samwich, Devs.thororen, EquicordDevs.neoarz, Devs.prism], settings, async start() { diff --git a/src/equicordplugins/remix/editor/Editor.tsx b/src/equicordplugins/remix/editor/Editor.tsx index f33661fcc..b08ce807a 100644 --- a/src/equicordplugins/remix/editor/Editor.tsx +++ b/src/equicordplugins/remix/editor/Editor.tsx @@ -11,7 +11,7 @@ import { Canvas } from "./components/Canvas"; import { Toolbar } from "./components/Toolbar"; import { imageToBlob, urlToImage } from "./utils/canvas"; -const FileUpload = findComponentByCodeLazy(".currentTarget.files)", "lineClamp:1"); +const FileUpload = findComponentByCodeLazy(".currentTarget.files", "lineClamp:1"); export const Editor = (props: { url?: string; }) => { const [file, setFile] = useState(undefined); diff --git a/src/equicordplugins/remix/index.tsx b/src/equicordplugins/remix/index.tsx index 23cfb6da6..5ac709c4e 100644 --- a/src/equicordplugins/remix/index.tsx +++ b/src/equicordplugins/remix/index.tsx @@ -17,7 +17,7 @@ import RemixModal from "./RemixModal"; import css from "./styles.css?managed"; const requireCreateStickerModal = extractAndLoadChunksLazy([".CREATE_STICKER_MODAL,", "isDisplayingIndividualStickers"]); -const requireSettingsMenu = extractAndLoadChunksLazy(['name:"UserSettings"'], /createPromise:.{0,20}(\i\.\i\("?.+?"?\).*?).then\(\i\.bind\(\i,"?(.+?)"?\)\).{0,50}"UserSettings"/); +const requireSettingsMenu = extractAndLoadChunksLazy(['"AppSkeleton"'], /createPromise:.{0,20}(\i\.\i\("?.+?"?\).*?).then\(\i\.bind\(\i,"?(.+?)"?\)\).{0,50}\}\),(?=.{0,15}createPromise.*?\}\),)/); const PendingReplyStore = findStoreLazy("PendingReplyStore"); const validMediaTypes = ["image/png", "image/jpeg", "image/jpg", "image/webp"]; diff --git a/src/equicordplugins/scheduledMessages/index.tsx b/src/equicordplugins/scheduledMessages/index.tsx index 25ff2edb5..7fee1cbd2 100644 --- a/src/equicordplugins/scheduledMessages/index.tsx +++ b/src/equicordplugins/scheduledMessages/index.tsx @@ -8,7 +8,7 @@ import "./styles.css"; import { MessageOptions } from "@api/MessageEvents"; import { definePluginSettings } from "@api/Settings"; -import { EquicordDevs } from "@utils/constants"; +import { Devs, EquicordDevs } from "@utils/constants"; import definePlugin, { OptionType } from "@utils/types"; import { isScheduleModeEnabled, ScheduledMessagesButton, setScheduleModeEnabled } from "./components/ChatBarButton"; @@ -86,7 +86,7 @@ function handleReactionEvent(event: FluxReactionEvent): void { export default definePlugin({ name: "ScheduledMessages", description: "Schedule messages to be sent at a specific time or after a delay.", - authors: [EquicordDevs.mmeta, EquicordDevs.prism], + authors: [EquicordDevs.mmeta, Devs.prism], settings, flux: { diff --git a/src/equicordplugins/showSongName/index.tsx b/src/equicordplugins/showSongName/index.tsx index 9ce6ce8f4..96cdd5ae7 100644 --- a/src/equicordplugins/showSongName/index.tsx +++ b/src/equicordplugins/showSongName/index.tsx @@ -4,13 +4,13 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import { EquicordDevs } from "@utils/constants"; +import { Devs } from "@utils/constants"; import definePlugin from "@utils/types"; export default definePlugin({ name: "ShowSongName", description: "Shows song name instead of artist for Spotify activity", - authors: [EquicordDevs.prism], + authors: [Devs.prism], patches: [ { diff --git a/src/equicordplugins/sidebarChat/index.tsx b/src/equicordplugins/sidebarChat/index.tsx index 6a964716d..562d2638b 100644 --- a/src/equicordplugins/sidebarChat/index.tsx +++ b/src/equicordplugins/sidebarChat/index.tsx @@ -69,9 +69,9 @@ const WindowLaunchIcon = findComponentByCodeLazy("1-1h6a1 1 0 1 0 0-2H5Z"); const XSmallIcon = findComponentByCodeLazy("1.4L12 13.42l5.3 5.3Z"); const Chat = findComponentByCodeLazy("filterAfterTimestamp:", "chatInputType"); const Resize = findComponentByCodeLazy("sidebarType:", "RESIZE_HANDLE_WIDTH)"); -const ChannelHeader = findComponentByCodeLazy(".GUILD_ANNOUNCEMENT", '"channel-".concat'); +const ChannelHeader = findComponentByCodeLazy(".GUILD_ANNOUNCEMENT", "`channel-"); const PopoutWindow = findComponentByCodeLazy("Missing guestWindow reference"); -const FullChannelView = findComponentByCodeLazy("showFollowButton:(null"); +const FullChannelView = findComponentByCodeLazy(/showFollowButton:\i\?\.type===/); const WanderingCubesLoading = findComponentByCodeLazy('="wanderingCubes"'); const ChatInputTypes = findByPropsLazy("FORM", "NORMAL"); @@ -82,7 +82,7 @@ const ChannelSectionStore = findStoreLazy("ChannelSectionStore"); const requireChannelContextMenu = extractAndLoadChunksLazy( ["&&this.handleActivitiesPopoutClose(),"], - new RegExp(DefaultExtractAndLoadChunksRegex.source + ".{1,150}isFavorite") + new RegExp(DefaultExtractAndLoadChunksRegex.source + ".{1,250}hasActiveThread") ); const requireForumView = extractAndLoadChunksLazy( diff --git a/src/equicordplugins/splitLargeMessages/index.ts b/src/equicordplugins/splitLargeMessages/index.ts index 0e52af7f4..58609b569 100644 --- a/src/equicordplugins/splitLargeMessages/index.ts +++ b/src/equicordplugins/splitLargeMessages/index.ts @@ -134,9 +134,9 @@ export default definePlugin({ }, { - find: '(this,"hideAutocomplete"', // disable file conversion + find: ".onHideAutocomplete?", // disable file conversion replacement: { - match: /if\(\i.length>\i\)/, + match: /(?<=getData\(\i\.type\);)if\(\i.length>\i\)/, replace: "if(false)", }, } diff --git a/src/equicordplugins/statusPresets/index.tsx b/src/equicordplugins/statusPresets/index.tsx index 06e5db6f0..113b4052b 100644 --- a/src/equicordplugins/statusPresets/index.tsx +++ b/src/equicordplugins/statusPresets/index.tsx @@ -152,7 +152,7 @@ export default definePlugin({ { find: '"CustomStatusModalWithPreview"', replacement: { - match: /(?<=(\i)\.state\).*?)\{text:\i\.\i\.\i\(\i\.\i#{intl::SAVE}\)/, + match: /(?<=(\i)\?\.state\?\?.*?)\{text:\i\.\i\.\i\(\i\.\i#{intl::SAVE}\)/, replace: "$self.renderRememberButton($1),$&" } }, diff --git a/src/equicordplugins/stickerBlocker/index.tsx b/src/equicordplugins/stickerBlocker/index.tsx index d10250b58..66656cda3 100644 --- a/src/equicordplugins/stickerBlocker/index.tsx +++ b/src/equicordplugins/stickerBlocker/index.tsx @@ -133,9 +133,9 @@ export default definePlugin({ authors: [Devs.Samwich], patches: [ { - find: /\i\.\i\.STICKER_MESSAGE/, + find: ".STICKERS_CONSTANTS_STICKER_DIMENSION)", replacement: { - match: /}\),\(null!=\i\?\i:(\i)\)\.name]}\);/, + match: /}\),\(\i\?\?\i\)\.name\]\}\);/, replace: "$& if($self.isBlocked($1.id)) return($self.blockedComponent($1));" } } diff --git a/src/equicordplugins/tidalEmbeds/index.tsx b/src/equicordplugins/tidalEmbeds/index.tsx index 7ca7d629a..1e9269859 100644 --- a/src/equicordplugins/tidalEmbeds/index.tsx +++ b/src/equicordplugins/tidalEmbeds/index.tsx @@ -14,7 +14,7 @@ export default definePlugin({ dependencies: ["MessageUpdaterAPI"], patches: [ { - find: "}renderEmbeds(", + find: "renderEmbeds(", replacement: { match: /(?<=renderEmbeds\(\i\){.+?embeds\.map\(\((\i),\i\)?=>{)/, replace: "$&if($self.isTidalEmbed($1))return null;" diff --git a/src/equicordplugins/universalMention/index.tsx b/src/equicordplugins/universalMention/index.tsx index 1e893d2c2..2d8a977bb 100644 --- a/src/equicordplugins/universalMention/index.tsx +++ b/src/equicordplugins/universalMention/index.tsx @@ -60,7 +60,7 @@ export default definePlugin({ predicate: () => settings.store.globalMention || settings.store.onlyDMUsers, }, { - match: /(?<=\i=)\i\.recipients\.map\(.{0,100}:null\}\}\)/, + match: /(?<=\i=)\i\.recipients\.map\(.{0,100}\?\?null\}\)\)/, replace: "$self.useFilter(true)", } ], diff --git a/src/equicordplugins/unreadBadgeCount/index.tsx b/src/equicordplugins/unreadBadgeCount/index.tsx index 0ebc25bfd..0f08d06cd 100644 --- a/src/equicordplugins/unreadBadgeCount/index.tsx +++ b/src/equicordplugins/unreadBadgeCount/index.tsx @@ -14,7 +14,7 @@ import { ReadStateStore, useStateFromStores } from "@webpack/common"; const UserGuildSettingsStore = findStoreLazy("UserGuildSettingsStore"); const JoinedThreadsStore = findStoreLazy("JoinedThreadsStore"); -const NumberBadge = findComponentByCodeLazy("BADGE_NOTIFICATION_BACKGROUND", '"renderBadgeCount"'); +const NumberBadge = findComponentByCodeLazy("BADGE_NOTIFICATION_BACKGROUND", "let{count:"); const settings = definePluginSettings({ showOnMutedChannels: { diff --git a/src/equicordplugins/urlHighlighter/index.tsx b/src/equicordplugins/urlHighlighter/index.tsx index ac70ac4ca..6fbe9ba77 100644 --- a/src/equicordplugins/urlHighlighter/index.tsx +++ b/src/equicordplugins/urlHighlighter/index.tsx @@ -10,7 +10,7 @@ import { definePluginSettings } from "@api/Settings"; import { Button } from "@components/Button"; import ErrorBoundary from "@components/ErrorBoundary"; import { Heading } from "@components/Heading"; -import { EquicordDevs } from "@utils/constants"; +import { Devs } from "@utils/constants"; import { classNameFactory } from "@utils/css"; import definePlugin, { OptionType } from "@utils/types"; import { findComponentByCodeLazy } from "@webpack"; @@ -121,14 +121,14 @@ function getMatchingPattern(url: string): PatternEntry | null { export default definePlugin({ name: "UrlHighlighter", description: "Highlights URLs in messages that match your patterns.", - authors: [EquicordDevs.prism], + authors: [Devs.prism], settings, patches: [ { - find: '"messageId","channelId"', + find: ".MASKED_LINK),", replacement: { - match: /,children:null!=\i\?\i:\i/, + match: /,children:\i\?\?\i/, replace: "$&,...$self.getProps(arguments[0])" } } diff --git a/src/equicordplugins/userpfp/index.tsx b/src/equicordplugins/userpfp/index.tsx index ebbdaf4b2..5f75451a7 100644 --- a/src/equicordplugins/userpfp/index.tsx +++ b/src/equicordplugins/userpfp/index.tsx @@ -29,7 +29,7 @@ const cl = classNameFactory("vc-userpfp-"); const DONO_URL = "https://ko-fi.com/coolesding"; const INVITE_LINK = "userpfp-1129784704267210844"; -export const requireSettingsMenu = extractAndLoadChunksLazy(['name:"UserSettings"'], /createPromise:.{0,20}(\i\.\i\("?.+?"?\).*?).then\(\i\.bind\(\i,"?(.+?)"?\)\).{0,50}"UserSettings"/); +export const requireSettingsMenu = extractAndLoadChunksLazy(['"AppSkeleton"'], /createPromise:.{0,20}(\i\.\i\("?.+?"?\).*?).then\(\i\.bind\(\i,"?(.+?)"?\)\).{0,50}\}\),(?=.{0,15}createPromise.*?\}\),)/); export const KEY_DATASTORE = "vencord-custom-avatars"; export const data = { avatars: {} as Record }; diff --git a/src/plugins/_api/commands.ts b/src/plugins/_api/commands.ts index 2af65b6f9..3a86a3cb9 100644 --- a/src/plugins/_api/commands.ts +++ b/src/plugins/_api/commands.ts @@ -52,11 +52,6 @@ export default definePlugin({ { find: "#{intl::COMMANDS_OPTIONAL_COUNT}", replacement: [ - { - // ...children: p?.name - match: /(?<=:(\i)\.displayDescription\}.{0,200}children:).{0,50}\.name(?=\}\))/, - replace: "$1.plugin||($&)" - }, { match: /children:(?=\i\?\?\i\?\.name)(?<=command:(\i),.+?)/, replace: "children:$1.plugin??" diff --git a/src/plugins/_api/dynamicImageModalApi.ts b/src/plugins/_api/dynamicImageModalApi.ts index 58ee2989f..959f490bf 100644 --- a/src/plugins/_api/dynamicImageModalApi.ts +++ b/src/plugins/_api/dynamicImageModalApi.ts @@ -13,7 +13,8 @@ export default definePlugin({ description: "Allows you to omit either width or height when opening an image modal", patches: [ { - find: ".renderLinkComponent)?", + // TODO: bundler compat + find: /\.renderLinkComponent[)?]\?/, replacement: { // widthAndHeightPassed = w != null && w !== 0 && h == null || h === 0 match: /(?<=\i=)(null!=\i&&0!==\i)&&(null!=\i&&0!==\i)/, diff --git a/src/plugins/_api/messageUpdater.ts b/src/plugins/_api/messageUpdater.ts index 8f6cca26a..d029456e7 100644 --- a/src/plugins/_api/messageUpdater.ts +++ b/src/plugins/_api/messageUpdater.ts @@ -27,7 +27,7 @@ export default definePlugin({ patches: [ { // Message accessories have a custom logic to decide if they should render again, so we need to make it not ignore changed message reference - find: "}renderEmbeds(", + find: "}renderStickersAccessories(", replacement: { match: /(?<=this.props,\i,\[)"message",/, replace: "" diff --git a/src/plugins/betterGifAltText/index.ts b/src/plugins/betterGifAltText/index.ts index 5d9b188ea..0a381e547 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: ".modalContext})};", replacement: { match: /(return.{0,10}\.jsx.{0,50}isWindowFocused)/, replace: diff --git a/src/plugins/betterGifPicker/index.ts b/src/plugins/betterGifPicker/index.ts index 99ad9071c..cb2675886 100644 --- a/src/plugins/betterGifPicker/index.ts +++ b/src/plugins/betterGifPicker/index.ts @@ -25,11 +25,13 @@ export default definePlugin({ settings, patches: [ { - find: '"state",{resultType:', - replacement: [{ - match: /(?<="state",{resultType:)null/, - replace: '"Favorites"' - }] + find: "renderHeaderContent(){", + replacement: [ + { + match: /(?<=state={resultType:)null/, + replace: '"Favorites"' + } + ] }, { find: "#{intl::NO_GIF_FAVORITES_HOW_TO_FAVORITE}", diff --git a/src/plugins/betterSessions/index.tsx b/src/plugins/betterSessions/index.tsx index 78aea6133..b6dabbaa0 100644 --- a/src/plugins/betterSessions/index.tsx +++ b/src/plugins/betterSessions/index.tsx @@ -23,15 +23,14 @@ import { definePluginSettings } from "@api/Settings"; import ErrorBoundary from "@components/ErrorBoundary"; import { Devs } from "@utils/constants"; import definePlugin, { OptionType } from "@utils/types"; -import { findByPropsLazy, findComponentByCodeLazy, findCssClassesLazy, findStoreLazy } from "@webpack"; -import { Constants, React, RestAPI, Tooltip } from "@webpack/common"; +import { findComponentByCodeLazy, findCssClassesLazy, findStoreLazy } from "@webpack"; +import { Constants, React, RestAPI, SettingsRouter, Tooltip } from "@webpack/common"; import { RenameButton } from "./components/RenameButton"; import { Session, SessionInfo } from "./types"; import { fetchNamesFromDataStore, getDefaultName, GetOsColor, GetPlatformIcon, savedSessionsCache, saveSessionsToDataStore } from "./utils"; const AuthSessionsStore = findStoreLazy("AuthSessionsStore"); -const UserSettingsModal = findByPropsLazy("saveAccountChanges", "open"); const TimestampClasses = findCssClassesLazy("timestamp", "blockquoteContainer"); const SessionIconClasses = findCssClassesLazy("sessionIcon"); @@ -175,7 +174,7 @@ export default definePlugin({ title: "BetterSessions", body: `New session:\n${session.client_info.os} · ${session.client_info.platform} · ${session.client_info.location}`, permanent: true, - onClick: () => UserSettingsModal.open("Sessions") + onClick: () => SettingsRouter.openUserSettings("sessions_panel") }); } diff --git a/src/plugins/betterSettings/index.tsx b/src/plugins/betterSettings/index.tsx index 079ec351e..484fdd5e7 100644 --- a/src/plugins/betterSettings/index.tsx +++ b/src/plugins/betterSettings/index.tsx @@ -101,8 +101,13 @@ export default definePlugin({ find: "this.renderArtisanalHack()", replacement: [ { // Fade in on layer - match: /(?<=\((\i),"contextType",\i\.\i\);)/, - replace: "$1=$self.Layer;", + // class Layer { + // static contextType = ...; + // ... + // } + // class OtherClass { + match: /(static contextType=\i\.\i;.+?})(?=class)(?<=class (\i).+?)/, + replace: (_, before, Layer) => `${before};${Layer}=$self.Layer;`, predicate: () => settings.store.disableFade }, { // Lazy-load contents @@ -129,8 +134,8 @@ export default definePlugin({ { // Load menu TOC eagerly find: "#{intl::USER_SETTINGS_WITH_BUILD_OVERRIDE}", replacement: { - match: /(\i)\(this,"handleOpenSettingsContextMenu",.{0,100}?null!=\i&&.{0,100}?(await [^};]*?\)\)).*?,(?=\1\(this)/, - replace: "$&(async ()=>$2)()," + match: /(?=handleOpenSettingsContextMenu=.{0,100}?null!=\i&&.{0,100}?(await [^};]*?\)\)))/, + replace: "_vencordBetterSettingsEagerLoad=(async ()=>$1)();" }, predicate: () => settings.store.eagerLoad }, diff --git a/src/plugins/blurNsfw/index.ts b/src/plugins/blurNsfw/index.ts index 61923894e..d37545836 100644 --- a/src/plugins/blurNsfw/index.ts +++ b/src/plugins/blurNsfw/index.ts @@ -49,7 +49,7 @@ export default definePlugin({ patches: [ { - find: "}renderEmbeds(", + find: "}renderStickersAccessories(", replacement: [ { match: /(\.renderReactions\(\i\).+?className:)/, diff --git a/src/plugins/consoleJanitor/index.tsx b/src/plugins/consoleJanitor/index.tsx index ac7dbbb24..bb2731552 100644 --- a/src/plugins/consoleJanitor/index.tsx +++ b/src/plugins/consoleJanitor/index.tsx @@ -148,10 +148,12 @@ export default definePlugin({ }, { find: "is not a valid locale.", - replacement: { - match: /\i\.error(?=\(""\.concat\(\i," is not a valid locale."\)\))/, - replace: "$self.Noop" - } + replacement: [ + { + match: /\i\.error(?=\(`\$\{\i\} is not a valid locale.`)/, + replace: "$self.Noop" + } + ] }, { find: '"AppCrashedFatalReport: getLastCrash not supported."', @@ -162,10 +164,12 @@ export default definePlugin({ }, { find: "RPCServer:WSS", - replacement: { - match: /\i\.error\("Error: "\.concat\((\i)\.message/, - replace: '!$1.message.includes("EADDRINUSE")&&$&' - } + replacement: [ + { + match: /\i\.error\(`Error: \$\{(\i)\.message\}/, + replace: '!$1.message.includes("EADDRINUSE")&&$&' + } + ] }, { find: "Tried getting Dispatch instance before instantiated", @@ -183,17 +187,21 @@ export default definePlugin({ }, { find: "failed to send analytics events", - replacement: { - match: /console\.error\("\[analytics\] failed to send analytics events query: "\.concat\(\i\)\)/, - replace: "" - } + replacement: [ + { + match: /console\.error\(`\[analytics\] failed to send analytics events query: \$\{\i\}`\)/, + replace: "" + } + ] }, { find: "Slow dispatch on", - replacement: { - match: /\i\.totalTime>\i&&\i\.verbose\("Slow dispatch on ".+?\)\);/, - replace: "" - } + replacement: [ + { + match: /\i\.totalTime>\i&&\i\.verbose\([`"]Slow dispatch on.{0,55}\);/, + replace: "" + }, + ] }, // Patches Discord generic logger function { diff --git a/src/plugins/consoleShortcuts/index.ts b/src/plugins/consoleShortcuts/index.ts index 9a6192e0b..8b158e6df 100644 --- a/src/plugins/consoleShortcuts/index.ts +++ b/src/plugins/consoleShortcuts/index.ts @@ -249,11 +249,13 @@ export default definePlugin({ patches: [ { - find: 'this,"_changeCallbacks",', - replacement: { - match: /\i\(this,"_changeCallbacks",/, - replace: "Reflect.defineProperty(this,Symbol.toStringTag,{value:this.getName(),configurable:!0,writable:!0,enumerable:!1}),$&" - } + find: "&&this.initializeIfNeeded()", + replacement: [ + { + match: /\i&&this\.initializeIfNeeded\(\)/, + replace: "$&,Reflect.defineProperty(this,Symbol.toStringTag,{value:this.getName(),configurable:!0,writable:!0,enumerable:!1})" + } + ] } ], diff --git a/src/plugins/customRPC/index.tsx b/src/plugins/customRPC/index.tsx index 50b6a41c7..44f18f6c1 100644 --- a/src/plugins/customRPC/index.tsx +++ b/src/plugins/customRPC/index.tsx @@ -227,7 +227,7 @@ export default definePlugin({ // Discord hides buttons on your own Rich Presence for some reason. This patch disables that behaviour patches: [ { - find: ".buttons.length)>=1", + find: ".USER_PROFILE_ACTIVITY_BUTTONS),", replacement: { match: /.getId\(\)===\i.id/, replace: "$& && false" diff --git a/src/plugins/decor/index.tsx b/src/plugins/decor/index.tsx index 388eb6fcd..ae327cdae 100644 --- a/src/plugins/decor/index.tsx +++ b/src/plugins/decor/index.tsx @@ -50,7 +50,7 @@ export default definePlugin({ find: "80,onlyAnimateOnHoverOrFocus:!", replacement: [ { - match: /(?<==)\i=>{let{children.{20,200}isSelected:\i=!1\}=\i/, + match: /(?<==)\i=>{let{children.{20,200}isSelected:\i=!1.{0,5}\}=\i/, replace: "$self.DecorationGridItem=$&", }, { @@ -104,7 +104,7 @@ export default definePlugin({ find, replacement: [ { - match: /(?<=userValue.{0,25}void 0:)((\i)\.avatarDecoration)/, + match: /(?<=userValue:)((\i)(?:.{0,10})?\.avatarDecoration)/, replace: "$self.useUserDecorAvatarDecoration($2)??$1" } ] @@ -114,7 +114,7 @@ export default definePlugin({ find: "#{intl::PREMIUM_UPSELL_PROFILE_AVATAR_DECO_INLINE_UPSELL_DESCRIPTION}", replacement: { match: /(#{intl::PREMIUM_UPSELL_PROFILE_AVATAR_DECO_INLINE_UPSELL_DESCRIPTION}.+?return null!=(\i)&&\()(null==\i)/, - replace: (_, rest, avatarDecoration, hasPurchase) => `${rest}(${avatarDecoration}.skuId!==$self.SKU_ID&&${hasPurchase})` + replace: (_, rest, avatarDecoration, hasPurchase) => `${rest}(${avatarDecoration}.skuId!==$self.SKU_ID&&${avatarDecoration}.skuId!==$self.RAW_SKU_ID&&${hasPurchase})` } } ], @@ -140,6 +140,7 @@ export default definePlugin({ }, SKU_ID, + RAW_SKU_ID, useUserDecorAvatarDecoration, diff --git a/src/plugins/decor/ui/modals/CreateDecorationModal.tsx b/src/plugins/decor/ui/modals/CreateDecorationModal.tsx index 0f0a4fb88..c99b00282 100644 --- a/src/plugins/decor/ui/modals/CreateDecorationModal.tsx +++ b/src/plugins/decor/ui/modals/CreateDecorationModal.tsx @@ -19,7 +19,7 @@ import { closeAllModals, ModalCloseButton, ModalContent, ModalFooter, ModalHeade import { filters, findComponentByCodeLazy, mapMangledModuleLazy } from "@webpack"; import { Button, FluxDispatcher, GuildStore, NavigationRouter, TextInput, useEffect, useMemo, UserStore, useState } from "@webpack/common"; -const FileUpload = findComponentByCodeLazy(".currentTarget.files)", "lineClamp:1"); +const FileUpload = findComponentByCodeLazy(".currentTarget.files", "lineClamp:1"); const { HelpMessage, HelpMessageTypes } = mapMangledModuleLazy('POSITIVE="positive', { HelpMessageTypes: filters.byProps("POSITIVE", "WARNING", "INFO"), diff --git a/src/plugins/devCompanion.dev/index.tsx b/src/plugins/devCompanion.dev/index.tsx index 852e79490..43449840c 100644 --- a/src/plugins/devCompanion.dev/index.tsx +++ b/src/plugins/devCompanion.dev/index.tsx @@ -51,6 +51,7 @@ export default definePlugin({ authors: [Devs.Ven, Devs.sadan], reporterTestable: ReporterTestable.None, isModified: true, + settings, toolboxActions: { Reconnect() { diff --git a/src/plugins/experiments/index.tsx b/src/plugins/experiments/index.tsx index 3861ed1f5..e80e1b433 100644 --- a/src/plugins/experiments/index.tsx +++ b/src/plugins/experiments/index.tsx @@ -20,7 +20,7 @@ import { React } from "@webpack/common"; import hideBugReport from "./hideBugReport.css?managed"; const KbdStyles = findByPropsLazy("key", "combo"); -const BugReporterExperiment = findLazy(m => m?.definition?.id === "2024-09_bug_reporter"); +const BugReporterExperiment = findLazy(m => m?.definition?.name === "2026-01-bug-reporter"); const modKey = IS_MAC ? "cmd" : "ctrl"; const altKey = IS_MAC ? "opt" : "alt"; @@ -100,6 +100,7 @@ export default definePlugin({ find: "Clear Treatment ", replacement: [ { + // TODO: stable compat optional chaining remove once some time has passed match: /\i\??\.isStaff\(\)/, replace: "true" }, @@ -130,7 +131,7 @@ export default definePlugin({ }, { // Expands the experiment regex to allow negative numbers as well as text in the last segment of the URL. - find: "?\"dev://experiment/\".concat", + find: '"^dev://experiment/', replacement: { match: /(\[0-9\]\+)/, replace: "[a-zA-Z0-9-]+" @@ -139,11 +140,6 @@ export default definePlugin({ { find: ".EXPERIMENT_TREATMENT&&null", replacement: [ - { - // Uses the label instead of the value for the button text in the experiment embed. - match: /"Clear Treatment ".concat\((\i).value\):"Apply Treatment ".concat\(\i.value\)/, - replace: '"Clear Treatment: ".concat($1.label):"Apply Treatment: ".concat($1.label)' - }, { // Allow linking experiments by their label instead of their value. match: /(?<=find\(\i=>)((\i).value===\i)/, @@ -160,7 +156,7 @@ export default definePlugin({ return !!labelCleaned && urlEndCleaned !== undefined && labelCleaned === urlEndCleaned; }, - start: () => !BugReporterExperiment.getCurrentConfig().hasBugReporterAccess && enableStyle(hideBugReport), + start: () => !BugReporterExperiment.getConfig().hasBugReporterAccess && enableStyle(hideBugReport), stop: () => disableStyle(hideBugReport), settingsAboutComponent: () => { diff --git a/src/plugins/fakeNitro/index.tsx b/src/plugins/fakeNitro/index.tsx index 29ccf1719..5a776bd6d 100644 --- a/src/plugins/fakeNitro/index.tsx +++ b/src/plugins/fakeNitro/index.tsx @@ -299,13 +299,13 @@ export default definePlugin({ { // Patch the rendered message content to add fake nitro emojis or remove sticker links predicate: () => settings.store.transformEmojis || settings.store.transformStickers, - match: /(?=return\{hasSpoilerEmbeds:\i,.{0,15}content:(\i))/, + match: /(?=return{hasSpoilerEmbeds:\i,hasBailedAst:\i,content:(\i))/, replace: (_, content) => `${content}=$self.patchFakeNitroEmojisOrRemoveStickersLinks(${content},arguments[2]?.formatInline);` } ] }, { - find: "}renderEmbeds(", + find: "}renderStickersAccessories(", replacement: [ { // Call our function to decide whether the embed should be ignored or not diff --git a/src/plugins/fullSearchContext/index.tsx b/src/plugins/fullSearchContext/index.tsx index d5b9c8a1e..2f20cd53b 100644 --- a/src/plugins/fullSearchContext/index.tsx +++ b/src/plugins/fullSearchContext/index.tsx @@ -34,7 +34,7 @@ interface CopyIdMenuItemProps { } let CopyIdMenuItem: (props: CopyIdMenuItemProps) => React.ReactElement | null = NoopComponent; -waitFor(filters.componentByCode('"devmode-copy-id-".concat'), m => CopyIdMenuItem = m); +waitFor(filters.componentByCode('"cannot copy null text"'), m => CopyIdMenuItem = m); function MessageMenu({ message, channel, onHeightUpdate }) { const canReport = message.author && diff --git a/src/plugins/fullUserInChatbox/index.tsx b/src/plugins/fullUserInChatbox/index.tsx index a9d4d61d9..9ac4f811d 100644 --- a/src/plugins/fullUserInChatbox/index.tsx +++ b/src/plugins/fullUserInChatbox/index.tsx @@ -28,7 +28,7 @@ export default definePlugin({ patches: [ { // Same find as RoleColorEverywhere chatbox mentions - find: ':"text":', + find: '"text":"locked"', replacement: { match: /(hidePersonalInformation\).+?)(if\(null!=\i\){.+?return \i)(?=})/, replace: "$1return $self.UserMentionComponent({...arguments[0],originalComponent:()=>{$2}});" diff --git a/src/plugins/gifPaste/index.ts b/src/plugins/gifPaste/index.ts index 97fed9613..65ea464c4 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: "$&if (!this.props.className) return $self.handleSelect($1);" } }], diff --git a/src/plugins/imageZoom/index.tsx b/src/plugins/imageZoom/index.tsx index 724bda2fb..bbd9b82a6 100644 --- a/src/plugins/imageZoom/index.tsx +++ b/src/plugins/imageZoom/index.tsx @@ -162,7 +162,7 @@ export default definePlugin({ patches: [ { - find: ".renderLinkComponent)?", + find: "disableArrowKeySeek:!0", replacement: [ { match: /useFullWidth:!0,shouldLink:/, diff --git a/src/plugins/loadingQuotes/index.ts b/src/plugins/loadingQuotes/index.ts index 9986769fa..8c63fe5a2 100644 --- a/src/plugins/loadingQuotes/index.ts +++ b/src/plugins/loadingQuotes/index.ts @@ -66,11 +66,11 @@ export default definePlugin({ find: "#{intl::LOADING_DID_YOU_KNOW}", replacement: [ { - match: /"_loadingText".+?(?=(\i)\[.{0,10}\.random)/, + match: /_loadingText.+?(?=(\i)\[.{0,10}\.random)/, replace: "$&$self.mutateQuotes($1)," }, { - match: /"_eventLoadingText".+?(?=(\i)\[.{0,10}\.random)/, + match: /_eventLoadingText.+?(?=(\i)\[.{0,10}\.random)/, replace: "$&$self.mutateQuotes($1),", predicate: () => settings.store.replaceEvents } diff --git a/src/plugins/mentionAvatars/index.tsx b/src/plugins/mentionAvatars/index.tsx index 2351592d3..829f49e8e 100644 --- a/src/plugins/mentionAvatars/index.tsx +++ b/src/plugins/mentionAvatars/index.tsx @@ -52,10 +52,12 @@ export default definePlugin({ patches: [{ // HEY THOR UPDATE SHOW ME YOUR NAME IF THIS SHIT CHANGES TY :) find: ".USER_MENTION)", - replacement: { - match: /"@"\.concat\((null!=\i\?\i:\i)\)(?<=\.useName\((\i)\).+?)/, - replace: "$self.renderUsername({username:$1,user:$2,showMeYourNameMention:typeof showMeYourNameMention!=='undefined'?showMeYourNameMention:undefined})" - } + replacement: [ + { + match: /children:`@\$\{(\i\?\?\i)\}`(?<=\.useName\((\i)\).+?)/, + replace: "children:$self.renderUsername({username:$1,user:$2,showMeYourNameMention:typeof showMeYourNameMention!=='undefined'?showMeYourNameMention:undefined})" + } + ] }, { find: ".ROLE_MENTION)", @@ -66,9 +68,9 @@ export default definePlugin({ }, { // show avatar in the chat input box - find: '.hasUniqueUsername()?null:"#"', + find: ".hasUniqueUsername()?null:`#", replacement: { - match: /(?<=,(\i)\).{0,55})"@"\.concat\((\i)\)/, + match: /(?<=,(\i)\).{0,55})`@\$\{(\i)\}`/, replace: "$self.renderInputMention($2,$1)" } }], diff --git a/src/plugins/messageClickActions/index.ts b/src/plugins/messageClickActions/index.ts index a016b25d1..b75c44ef0 100644 --- a/src/plugins/messageClickActions/index.ts +++ b/src/plugins/messageClickActions/index.ts @@ -200,6 +200,11 @@ const settings = definePluginSettings({ markers: makeRange(50, 500, 50), default: 150 }, + deferDoubleClickForTriple: { + type: OptionType.BOOLEAN, + description: "Delay double-click to allow triple-click actions (disables triple-click when off)", + default: true + }, selectionHoldTimeout: { type: OptionType.NUMBER, description: "Timeout to allow text selection (ms)", @@ -538,6 +543,12 @@ export default definePlugin({ } if (isTripleClick) { + if (!settings.store.deferDoubleClickForTriple) { + mouseDownCount = 0; + doubleClickDetected = false; + secondMouseDownTime = 0; + return; + } if (doubleClickTimeout) { clearTimeout(doubleClickTimeout); doubleClickTimeout = null; @@ -556,7 +567,14 @@ export default definePlugin({ } const canDoubleClick = (isModifierPressed(doubleClickModifier) || doubleClickModifier === "NONE") && doubleClickAction !== "NONE"; - const canTripleClick = isModifierPressed(tripleClickModifier) && tripleClickAction !== "NONE"; + const canTripleClick = + settings.store.deferDoubleClickForTriple && + isModifierPressed(tripleClickModifier) && + tripleClickAction !== "NONE"; + const shouldDeferDoubleClick = + canDoubleClick && + canTripleClick && + doubleClickModifier === tripleClickModifier; if (isDoubleClick) { doubleClickFired = true; @@ -576,7 +594,7 @@ export default definePlugin({ } }; - if (canTripleClick && canDoubleClick) { + if (shouldDeferDoubleClick) { if (doubleClickTimeout) { clearTimeout(doubleClickTimeout); } @@ -613,8 +631,10 @@ export default definePlugin({ secondMouseDownTime = 0; }; - const hasDoubleClickAction = settings.store.doubleClickAction !== "NONE" || settings.store.doubleClickOthersAction !== "NONE"; - if (hasDoubleClickAction && singleClickModifier === "NONE") { + const canDoubleClickWithCurrentModifier = + doubleClickAction !== "NONE" && + (doubleClickModifier === "NONE" || isModifierPressed(doubleClickModifier)); + if (canDoubleClickWithCurrentModifier && singleClickModifier === "NONE") { singleClickTimeout = setTimeout(() => { executeSingleClick(); singleClickTimeout = null; diff --git a/src/plugins/messageLogger/index.tsx b/src/plugins/messageLogger/index.tsx index eb2d8e006..0c21455ed 100644 --- a/src/plugins/messageLogger/index.tsx +++ b/src/plugins/messageLogger/index.tsx @@ -715,7 +715,7 @@ export default definePlugin({ { // Updated message transformer(?) - find: "THREAD_STARTER_MESSAGE?null==", + find: ".PREMIUM_REFERRAL&&(", replacement: [ { // Pass through editHistory & deleted & original attachments to the "edited message" transformer diff --git a/src/plugins/noBlockedMessages/index.ts b/src/plugins/noBlockedMessages/index.ts index 25db5d832..3c50240fa 100644 --- a/src/plugins/noBlockedMessages/index.ts +++ b/src/plugins/noBlockedMessages/index.ts @@ -106,7 +106,7 @@ export default definePlugin({ ] })), { - find: '"forum-post-action-bar-"', + find: "`forum-post-action-bar-", replacement: [ { match: /(?<=\);)(let \i=null,\i=\[\],\i=(\i))/, diff --git a/src/plugins/normalizeMessageLinks/index.ts b/src/plugins/normalizeMessageLinks/index.ts index 82076ef20..335cf27fc 100644 --- a/src/plugins/normalizeMessageLinks/index.ts +++ b/src/plugins/normalizeMessageLinks/index.ts @@ -15,8 +15,8 @@ export default definePlugin({ { find: "#{intl::COPY_MESSAGE_LINK}", replacement: { - match: /\.concat\(location\.host\)/, - replace: ".concat($self.normalizeHost(location.host))", + match: /(?<=(?:.concat\(|\/\/\$\{))location\.host/, + replace: "$self.normalizeHost(location.host)", }, }, ], diff --git a/src/plugins/onePingPerDM/index.ts b/src/plugins/onePingPerDM/index.ts index dfc0a3bf9..05dba7e80 100644 --- a/src/plugins/onePingPerDM/index.ts +++ b/src/plugins/onePingPerDM/index.ts @@ -47,7 +47,7 @@ const settings = definePluginSettings({ export default definePlugin({ name: "OnePingPerDM", - description: "If unread messages are sent by a user in DMs multiple times, you'll only receive one audio ping. Read the messages to reset the limit", + description: "If unread messages are sent by a user in DMs multiple times, you'll only receive one audio ping.", authors: [Devs.ProffDea], isModified: true, settings, diff --git a/src/plugins/pinDms/components/CreateCategoryModal.tsx b/src/plugins/pinDms/components/CreateCategoryModal.tsx index b35d2cd6c..4543fa6aa 100644 --- a/src/plugins/pinDms/components/CreateCategoryModal.tsx +++ b/src/plugins/pinDms/components/CreateCategoryModal.tsx @@ -26,7 +26,8 @@ interface ColorPickerWithSwatchesProps { const ColorPickerWithSwatches = findComponentByCodeLazy('id:"color-picker"'); -export const requireSettingsMenu = extractAndLoadChunksLazy(['name:"UserSettings"'], /createPromise:.{0,20}(\i\.\i\("?.+?"?\).*?).then\(\i\.bind\(\i,"?(.+?)"?\)\).{0,50}"UserSettings"/); +// 701663 this is terrible imo +export const requireSettingsMenu = extractAndLoadChunksLazy(['"AppSkeleton"'], /createPromise:.{0,20}(\i\.\i\("?.+?"?\).*?).then\(\i\.bind\(\i,"?(.+?)"?\)\).{0,50}\}\),(?=.{0,15}createPromise.*?\}\),)/); const cl = classNameFactory("vc-pindms-modal-"); diff --git a/src/plugins/pinDms/index.tsx b/src/plugins/pinDms/index.tsx index b2345ea1a..7559abaa9 100644 --- a/src/plugins/pinDms/index.tsx +++ b/src/plugins/pinDms/index.tsx @@ -73,7 +73,7 @@ export default definePlugin({ patches: [ { - find: '"private-channels-".concat(', + find: '"dm-quick-launcher"===', replacement: [ { // Filter out pinned channels from the private channel list @@ -88,15 +88,15 @@ export default definePlugin({ // Rendering { - match: /"renderRow",(\i)=>{(?<="renderDM",.+?(\i\.\i),\{channel:.+?)/, + match: /renderRow(?:",|=)(\i)=>{(?<=renderDM(?:",|=).+?(\i\.\i),\{channel:.+?)/, replace: "$&if($self.isChannelIndex($1.section, $1.row))return $self.renderChannel($1.section,$1.row,$2)();" }, { - match: /"renderSection",(\i)=>{/, + match: /renderSection(?:",|=)(\i)=>{/, replace: "$&if($self.isCategoryIndex($1.section))return $self.renderCategory($1);" }, { - match: /"renderSection".{0,300}?"span",{/, + match: /renderSection(?:",|=).{0,300}?"span",{/, replace: "$&...$self.makeSpanProps()," }, @@ -106,7 +106,7 @@ export default definePlugin({ replace: "$1($2-$self.categoryLen())" }, { - match: /"getRowHeight",\((\i),(\i)\)=>{/, + match: /getRowHeight(?:",|=)\((\i),(\i)\)=>{/, replace: "$&if($self.isChannelHidden($1,$2))return 0;" }, diff --git a/src/plugins/platformIndicators/index.tsx b/src/plugins/platformIndicators/index.tsx index 3923d1233..b2ed2043e 100644 --- a/src/plugins/platformIndicators/index.tsx +++ b/src/plugins/platformIndicators/index.tsx @@ -40,8 +40,7 @@ export interface Session { const SessionsStore = findStoreLazy("SessionsStore") as { getSessions(): Record; }; - -const { useStatusFillColor } = mapMangledModuleLazy(".concat(.5625*", { +const { useStatusFillColor } = mapMangledModuleLazy("translate(${.5625*", { useStatusFillColor: filters.byCode(".hex") }); @@ -261,8 +260,8 @@ export default definePlugin({ }, { // Fix sizes for mobile indicators which aren't online - match: /(?<=\(\i\.status,)(\i)(?=,(\i),\i\))/, - replace: (_, userStatus, isMobile) => `${isMobile}?"online":${userStatus}` + match: /(?<=\(\i\.status,)(\i)(?=,\{.{0,15}isMobile:(\i))/, + replace: '$2?"online":$1' }, { // Make isMobile true no matter the status diff --git a/src/plugins/revealAllSpoilers/index.ts b/src/plugins/revealAllSpoilers/index.ts index 814abb202..173632d7a 100644 --- a/src/plugins/revealAllSpoilers/index.ts +++ b/src/plugins/revealAllSpoilers/index.ts @@ -32,7 +32,7 @@ export default definePlugin({ { find: ".removeObscurity,", replacement: { - match: /(?<="removeObscurity",(\i)=>{)/, + match: /(?<=removeObscurity(?:",|=)(\i)=>{)/, replace: (_, event) => `$self.reveal(${event});` } } diff --git a/src/plugins/reviewDB/components/ReviewsView.tsx b/src/plugins/reviewDB/components/ReviewsView.tsx index 8b690b7ea..6ad0a3d69 100644 --- a/src/plugins/reviewDB/components/ReviewsView.tsx +++ b/src/plugins/reviewDB/components/ReviewsView.tsx @@ -32,7 +32,7 @@ const Transforms = findByPropsLazy("insertNodes", "textToText"); const Editor = findByPropsLazy("start", "end", "toSlateRange"); const ChatInputTypes = findByPropsLazy("FORM", "USER_PROFILE"); const InputComponent = findComponentByCodeLazy("editorClassName", "CHANNEL_TEXT_AREA"); -const createChannelRecordFromServer = findByCodeLazy(".GUILD_TEXT])", "fromServer)"); +const createChannelRecordFromServer = findByCodeLazy(".GUILD_TEXT]", "fromServer)"); interface UserProps { discordId: string; diff --git a/src/plugins/roleColorEverywhere/index.tsx b/src/plugins/roleColorEverywhere/index.tsx index d9eb37002..c9340fc6f 100644 --- a/src/plugins/roleColorEverywhere/index.tsx +++ b/src/plugins/roleColorEverywhere/index.tsx @@ -93,7 +93,7 @@ export default definePlugin({ // Slate { // Same find as FullUserInChatbox - find: ':"text":', + find: '"text":"locked"', replacement: [ { match: /let\{id:(\i),guildId:\i,channelId:(\i)[^}]*\}.*?\.\i,{(?=children)/, diff --git a/src/plugins/showHiddenChannels/index.tsx b/src/plugins/showHiddenChannels/index.tsx index 5b3bf3f6d..43a270a5b 100644 --- a/src/plugins/showHiddenChannels/index.tsx +++ b/src/plugins/showHiddenChannels/index.tsx @@ -159,7 +159,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;" } }, @@ -223,7 +223,7 @@ export default definePlugin({ }, { // Hide the new version of unreads box for hidden channels - find: '"ChannelListUnreadsStore",', + find: '"ChannelListUnreadsStore"', replacement: { match: /(?<=\.id\)\))(?=&&\(0,\i\.\i\)\((\i)\))/, replace: (_, channel) => `&&!$self.isHiddenChannel(${channel})` @@ -250,19 +250,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: (m, pushNotificationButtonExpression, channel, isLurking) => `${m}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: (m, pushNotificationButtonExpression, channel, isLurking) => `${m}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})` }, { @@ -355,7 +355,7 @@ export default definePlugin({ { // Show only the plus text without overflowed children amount // if the overflow amount is <= 0 and the component is used inside the HiddenChannelLockScreen - match: /(?<="\+"\.concat\()\i/, + match: /(?<=`\+\$\{)\i(?=\})/, replace: overflowTextAmount => "" + `$self.isHiddenChannel(typeof shcChannel!=="undefined"?shcChannel:void 0,true)&&(${overflowTextAmount}-1)<=0?"":${overflowTextAmount}` } diff --git a/src/plugins/showHiddenThings/index.ts b/src/plugins/showHiddenThings/index.ts index b788a8bd1..82ff7a77c 100644 --- a/src/plugins/showHiddenThings/index.ts +++ b/src/plugins/showHiddenThings/index.ts @@ -52,7 +52,7 @@ export default definePlugin({ }, }, { - find: "INVITES_DISABLED))||", + find: /\.INVITES_DISABLED\)(?:\))?\|\|/, predicate: () => settings.store.showInvitesPaused, replacement: { match: /\i\.\i\.can\(\i\.\i.MANAGE_GUILD,\i\)/, diff --git a/src/plugins/showMeYourName/index.tsx b/src/plugins/showMeYourName/index.tsx index 3b92e3136..512378cf3 100644 --- a/src/plugins/showMeYourName/index.tsx +++ b/src/plugins/showMeYourName/index.tsx @@ -894,7 +894,7 @@ const settings = definePluginSettings({ export default definePlugin({ name: "ShowMeYourName", description: "Display any permutation of custom nicknames, friend nicknames, server nicknames, display names, and usernames in chat.", - authors: [Devs.Rini, Devs.TheKodeToad, EquicordDevs.Etorix, Devs.sadan, EquicordDevs.prism], + authors: [Devs.Rini, Devs.TheKodeToad, EquicordDevs.Etorix, Devs.sadan, Devs.prism], tags: ["SMYN", "Nicknames", "Custom Nicknames",], isModified: true, settings, @@ -934,7 +934,7 @@ export default definePlugin({ replace: "const showMeYourNameMention=$self.getMentionNameElement(arguments[0]);$1" }, { - match: /(?<=onContextMenu:\i\},\i\),{children:)/, + match: /(?<=onContextMenu:\i,\.\.\.\i,children:)/, replace: "showMeYourNameMention??", predicate: () => !isPluginEnabled(mentionAvatars.name), } @@ -985,7 +985,7 @@ export default definePlugin({ // Replace names in reaction tooltips. find: "reactionTooltip1,", replacement: { - match: /(\i.\i.getName\((\i),null==(?:.{0,15}?)(\i)\))/, + match: /(\i.\i.getName\((\i),\i\?\.id,(\i)\))/, replace: "$self.getMemberListProfilesReactionsVoiceNameText({user:$3,guildId:$2,type:\"reactionsTooltip\"})??($1)" } }, diff --git a/src/plugins/spotifyCrack/index.ts b/src/plugins/spotifyCrack/index.ts index 37504be2e..505e53a12 100644 --- a/src/plugins/spotifyCrack/index.ts +++ b/src/plugins/spotifyCrack/index.ts @@ -51,7 +51,7 @@ export default definePlugin({ }, }, { - find: '"displayName","SpotifyStore")', + find: "}getPlayableComputerDevices(){", replacement: [ { predicate: () => settings.store.noSpotifyAutoPause, diff --git a/src/plugins/textReplace/index.tsx b/src/plugins/textReplace/index.tsx index e22bcf1c8..be50bd63f 100644 --- a/src/plugins/textReplace/index.tsx +++ b/src/plugins/textReplace/index.tsx @@ -266,7 +266,7 @@ export default definePlugin({ { find: "!1,hideSimpleEmbedContent", replacement: { - match: /(let{toAST:.{0,125}?)\(null!=\i\?\i:\i\).content/, + match: /(let{toAST:.{0,125}?)\(\i\?\?\i\).content/, replace: "const textReplaceContent=$self.modifyIncomingMessage(arguments[2]?.contentMessage??arguments[1]);$1textReplaceContent" } }, diff --git a/src/plugins/themeAttributes/index.ts b/src/plugins/themeAttributes/index.ts index 74a67fd0c..e71dec0ad 100644 --- a/src/plugins/themeAttributes/index.ts +++ b/src/plugins/themeAttributes/index.ts @@ -39,10 +39,12 @@ export default definePlugin({ // popout profiles { find: "#{intl::LABEL_WITH_ONLINE_STATUS}", - replacement: { - match: /src:null!=\i\?(\i).{1,50}"aria-hidden":!0/, - replace: "$&,style:$self.getAvatarStyles($1)" - } + replacement: [ + { + match: /src:(\i)\?\?void 0.{1,50}"aria-hidden":!0/, + replace: "$&,style:$self.getAvatarStyles($1)" + } + ] }, // chat avatars { diff --git a/src/plugins/typingTweaks/index.tsx b/src/plugins/typingTweaks/index.tsx index 7cb4a0a5f..b71e93bfd 100644 --- a/src/plugins/typingTweaks/index.tsx +++ b/src/plugins/typingTweaks/index.tsx @@ -131,7 +131,7 @@ export default definePlugin({ replace: "$self.renderTypingUsers({ users: arguments[0]?.typingUserObjects, guildId: arguments[0]?.channel?.guild_id, children: $& })" }, { - match: /(?<=function \i\(\i\)\{)(?=[^}]+?\{channel:\i,isThreadCreation:\i=!1\})/, + match: /(?<=function \i\(\i\)\{)(?=[^}]+?\{channel:\i,isThreadCreation:\i=!1,...\i\})/, replace: "let typingUserObjects = $self.useTypingUsers(arguments[0]?.channel);" }, { @@ -150,7 +150,7 @@ export default definePlugin({ ] }, { - find: "\"handleDismissInviteEducation\"", + find: "this.handleDismissInviteEducation", predicate: () => settings.store.amITyping, replacement: { match: /\i\.default\.getCurrentUser\(\)/, diff --git a/src/plugins/userMessagesPronouns/index.ts b/src/plugins/userMessagesPronouns/index.ts index 9eaab235f..56721e11f 100644 --- a/src/plugins/userMessagesPronouns/index.ts +++ b/src/plugins/userMessagesPronouns/index.ts @@ -44,7 +44,7 @@ export default definePlugin({ replacement: [ { // Add next to username (compact mode) - match: /className:\i\(\)\(\i\.className(?:,\i\.clickable)?,\i\)}\)\),(?=\i)/g, + match: /className:\i\(\)\(\i\.className(?:,\i\.\i)?,\i\)\}\)(?:\))?,(?=\i)/g, replace: "$&$self.CompactPronounsChatComponentWrapper(arguments[0]),", }, ] diff --git a/src/plugins/usrbg/index.tsx b/src/plugins/usrbg/index.tsx index 72e551c8b..b77efb8f7 100644 --- a/src/plugins/usrbg/index.tsx +++ b/src/plugins/usrbg/index.tsx @@ -58,9 +58,9 @@ export default definePlugin({ settings, patches: [ { - find: '.banner)==null?"COMPLETE"', + find: ':"SHOULD_LOAD");', replacement: { - match: /(?<=void 0:)\i.getPreviewBanner\(\i,\i,\i\)/, + match: /\i(?:\?)?.getPreviewBanner\(\i,\i,\i\)(?=.{0,100}"COMPLETE")/, replace: "$self.patchBannerUrl(arguments[0])||$&" } diff --git a/src/plugins/validReply/index.ts b/src/plugins/validReply/index.ts index 0f0a198dd..da0a25083 100644 --- a/src/plugins/validReply/index.ts +++ b/src/plugins/validReply/index.ts @@ -44,10 +44,12 @@ export default definePlugin({ }, { find: "ReferencedMessageStore", - replacement: { - match: /constructor\(\)\{\i\(this,"_channelCaches",new Map\)/, - replace: "$&;$self.setReplyStore(this);" - } + replacement: [ + { + match: /_channelCaches=new Map;/, + replace: "$&_=$self.setReplyStore(this);" + } + ] } ], diff --git a/src/plugins/viewIcons/index.tsx b/src/plugins/viewIcons/index.tsx index ee2a29493..ee678ed2d 100644 --- a/src/plugins/viewIcons/index.tsx +++ b/src/plugins/viewIcons/index.tsx @@ -205,10 +205,12 @@ export default definePlugin({ // Banners { find: 'backgroundColor:"COMPLETE"', - replacement: { - match: /(overflow:"visible",.{0,125}?!1\),)style:{(?=.+?backgroundImage:null!=(\i)\?"url\("\.concat\(\2,)/, - replace: (_, rest, bannerSrc) => `${rest}onClick:()=>${bannerSrc}!=null&&$self.openBanner(${bannerSrc}),style:{cursor:${bannerSrc}!=null?"pointer":void 0,` - } + replacement: [ + { + match: /(overflow:"visible",.{0,125}?!1\),)style:{(?=.+?backgroundImage:null!=(\i)\?`url\(\$\{\2\}\))/, + replace: (_, rest, bannerSrc) => `${rest}onClick:()=>${bannerSrc}!=null&&$self.openBanner(${bannerSrc}),style:{cursor:${bannerSrc}!=null?"pointer":void 0,` + } + ] }, // Group DMs top small & large icon { diff --git a/src/plugins/voiceMessages/index.tsx b/src/plugins/voiceMessages/index.tsx index c6a0bc94f..1f5249127 100644 --- a/src/plugins/voiceMessages/index.tsx +++ b/src/plugins/voiceMessages/index.tsx @@ -282,7 +282,7 @@ export const settings = definePluginSettings({ export default definePlugin({ name: "VoiceMessages", description: "Allows you to send voice messages like on mobile. To do so, right click the upload button and click Send Voice Message.", - authors: [Devs.Ven, Devs.Vap, Devs.Nickyux, EquicordDevs.Z1xus, EquicordDevs.prism], + authors: [Devs.Ven, Devs.Vap, Devs.Nickyux, EquicordDevs.Z1xus, Devs.prism], settings, contextMenus: { diff --git a/src/plugins/webContextMenus.web/index.ts b/src/plugins/webContextMenus.web/index.ts index ae5b8414f..2076404ab 100644 --- a/src/plugins/webContextMenus.web/index.ts +++ b/src/plugins/webContextMenus.web/index.ts @@ -24,9 +24,9 @@ import { saveFile } from "@utils/web"; import { filters, mapMangledModuleLazy } from "@webpack"; import { ComponentDispatch } from "@webpack/common"; -const ctxMenuCallbacks = mapMangledModuleLazy('.tagName)==="TEXTAREA"||', { - contextMenuCallbackWeb: filters.byCode('.tagName)==="INPUT"||'), - contextMenuCallbackNative: filters.byCode('.tagName)==="TEXTAREA"||') +const ctxMenuCallbacks = mapMangledModuleLazy('closest("[contenteditable=true]")', { + contextMenuCallbackWeb: filters.byCode('"[contenteditable=true]"'), + contextMenuCallbackNative: filters.byCode('.getPropertyValue("-webkit-user-select")') }); async function fetchImage(url: string) { diff --git a/src/plugins/webScreenShareFixes.web/index.ts b/src/plugins/webScreenShareFixes.web/index.ts index 624423001..e7fbc178e 100644 --- a/src/plugins/webScreenShareFixes.web/index.ts +++ b/src/plugins/webScreenShareFixes.web/index.ts @@ -18,17 +18,17 @@ export default definePlugin({ find: "x-google-max-bitrate", replacement: [ { - match: /"x-google-max-bitrate=".concat\(\i\)/, - replace: '"x-google-max-bitrate=".concat("80_000")' + match: /`x-google-max-bitrate=\$\{\i\}`/, + replace: '"x-google-max-bitrate=80_000"' }, { match: ";level-asymmetry-allowed=1", replace: ";b=AS:800000;level-asymmetry-allowed=1" }, { - match: /;usedtx=".concat\((\i)\?"0":"1"\)/, - replace: '$&.concat($1?";stereo=1;sprop-stereo=1":"")' - } + match: /;usedtx=\$\{(\i)\?"0":"1"\}/, + replace: '$&${$1?";stereo=1;sprop-stereo=1":""}' + }, ] } ] diff --git a/src/plugins/whoReacted/index.tsx b/src/plugins/whoReacted/index.tsx index 55804b442..cb2d6f977 100644 --- a/src/plugins/whoReacted/index.tsx +++ b/src/plugins/whoReacted/index.tsx @@ -110,7 +110,7 @@ export default definePlugin({ find: "cleanAutomaticAnchor(){", replacement: { - match: /constructor\(\i\)\{(?=.{0,100}automaticAnchor)/, + match: /constructor\(\i\)\{(?=.{0,100}(?:automaticAnchor|\.messages\.loadingMore))/, replace: "$&$self.setScrollObj(this);" } } diff --git a/src/webpack/common/components.ts b/src/webpack/common/components.ts index f44ba0343..e830e52ef 100644 --- a/src/webpack/common/components.ts +++ b/src/webpack/common/components.ts @@ -107,7 +107,7 @@ waitFor(m => { } const str = String(m); - return str.includes(".resolve({theme:null") && !str.includes("useMemo"); + return str.includes(".resolve({theme:") && str.includes('"refresh-fast-follow-avatars"') && !str.includes("useMemo"); }, m => useToken = m); export const MaskedLink = waitForComponent("MaskedLink", filters.componentByCode("MASKED_LINK)")); diff --git a/src/webpack/common/utils.ts b/src/webpack/common/utils.ts index f6176e36b..30fec83a6 100644 --- a/src/webpack/common/utils.ts +++ b/src/webpack/common/utils.ts @@ -147,7 +147,7 @@ export const UploadHandler = { export const ApplicationAssetUtils = mapMangledModuleLazy("getAssetImage: size must === [", { fetchAssetIds: filters.byCode('.startsWith("http:")', ".dispatch({"), - getAssetFromImageURL: filters.byCode("].serialize(", ',":"'), + getAssetFromImageURL: filters.byCode("].serialize(", ":null"), getAssetImage: filters.byCode("getAssetImage: size must === ["), getAssets: filters.byCode(".assets") }); @@ -164,7 +164,7 @@ export const ChannelRouter: t.ChannelRouter = mapMangledModuleLazy('"Thread must }); export let SettingsRouter: any; -waitFor(["open", "saveAccountChanges"], m => SettingsRouter = m); +waitFor(["openUserSettings", "USER_SETTINGS_MODAL_KEY"], m => SettingsRouter = m); export const PermissionsBits: t.PermissionsBits = findLazy(m => typeof m.ADMINISTRATOR === "bigint");