diff --git a/src/plugins/_api/chatButtons.ts b/src/plugins/_api/chatButtons.ts index 79f4e154b..432c66bf3 100644 --- a/src/plugins/_api/chatButtons.ts +++ b/src/plugins/_api/chatButtons.ts @@ -16,7 +16,7 @@ export default definePlugin({ { find: '"sticker")', replacement: { - match: /let (\i)=\(0,\i\.chain\).+?;(?=return 0===\1\.length)/, + match: /let (\i)=\(0,\i\.chain\).{0,150}?;(?=return 0===\1\.length)/, replace: "$&Vencord.Api.ChatButtons._injectButtons($1,arguments[0]);" } } diff --git a/src/plugins/_api/dynamicImageModalApi.ts b/src/plugins/_api/dynamicImageModalApi.ts index 419beda22..58ee2989f 100644 --- a/src/plugins/_api/dynamicImageModalApi.ts +++ b/src/plugins/_api/dynamicImageModalApi.ts @@ -13,7 +13,7 @@ export default definePlugin({ description: "Allows you to omit either width or height when opening an image modal", patches: [ { - find: "useFullWidth:!0,shouldLink:", + 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/_core/settings.tsx b/src/plugins/_core/settings.tsx index 7d30c5904..2dbf3f9b9 100644 --- a/src/plugins/_core/settings.tsx +++ b/src/plugins/_core/settings.tsx @@ -133,14 +133,14 @@ export default definePlugin({ replace: "$&.replace(/^./, c => c.toUpperCase())" }, { - match: /"text-xxs\/normal".+?(?=null!=(\i)&&(.{0,20}\i\.Text.{0,200}?,children:).{0,15}?("span"),({className:\i\.\i,children:\["Build Override: ",\1\.id\]\})\)\}\))/, + match: /"text-xxs\/normal".{0,300}?(?=null!=(\i)&&(.{0,20}\i\.Text.{0,200}?,children:).{0,15}?("span"),({className:\i\.\i,children:\["Build Override: ",\1\.id\]\})\)\}\))/, replace: (m, _buildOverride, makeRow, component, props) => { props = props.replace(/children:\[.+\]/, ""); return `${m},$self.makeInfoElements(${component},${props}).map(e=>${makeRow}e})),`; } }, { - match: /"text-xs\/normal".+?\[\(0,\i\.jsxs?\)\((.{1,10}),(\{[^{}}]+\{.{0,20}className:\i.\i,.+?\})\)," "/, + match: /"text-xs\/normal".{0,300}?\[\(0,\i\.jsxs?\)\((.{1,10}),(\{[^{}}]+\{.{0,20}className:\i.\i,.+?\})\)," "/, replace: (m, component, props) => { props = props.replace(/children:\[.+\]/, ""); return `${m},$self.makeInfoElements(${component},${props})`; diff --git a/src/plugins/anonymiseFileNames/index.tsx b/src/plugins/anonymiseFileNames/index.tsx index 8e965a12e..2ecd5a43c 100644 --- a/src/plugins/anonymiseFileNames/index.tsx +++ b/src/plugins/anonymiseFileNames/index.tsx @@ -26,7 +26,7 @@ import { CloudUpload } from "@vencord/discord-types"; import { findByCodeLazy } from "@webpack"; import { useState } from "@webpack/common"; -const ActionBarIcon = findByCodeLazy(".actionBarIcon"); +const ActionBarIcon = findByCodeLazy("Children.map", "isValidElement", "dangerous:"); const enum Methods { Random, diff --git a/src/plugins/blurNsfw/index.ts b/src/plugins/blurNsfw/index.ts index 43613f6f7..61923894e 100644 --- a/src/plugins/blurNsfw/index.ts +++ b/src/plugins/blurNsfw/index.ts @@ -53,7 +53,7 @@ export default definePlugin({ replacement: [ { match: /(\.renderReactions\(\i\).+?className:)/, - replace: "$&(this.props.channel.nsfw || $self.settings.store.blurAllChannels ? ' vc-nsfw-img': '')+" + replace: '$&(this.props?.channel?.nsfw || $self.settings.store.blurAllChannels ? "vc-nsfw-img ": "")+' } ] } diff --git a/src/plugins/decor/index.tsx b/src/plugins/decor/index.tsx index 7d6881710..3e641c212 100644 --- a/src/plugins/decor/index.tsx +++ b/src/plugins/decor/index.tsx @@ -98,7 +98,7 @@ export default definePlugin({ }, ...[ '"Message Username"', // Messages - '?"white":"black",width', // Nameplate preview + "#{intl::COLLECTIBLES_NAMEPLATE_PREVIEW_A11Y}", // Nameplate preview "#{intl::ayozFl::raw}", // Avatar preview ].map(find => ({ find, diff --git a/src/plugins/friendsSince/index.tsx b/src/plugins/friendsSince/index.tsx index 38995d397..006ea2fce 100644 --- a/src/plugins/friendsSince/index.tsx +++ b/src/plugins/friendsSince/index.tsx @@ -33,6 +33,14 @@ export default definePlugin({ replace: "$&,$self.FriendsSinceComponent({userId:$1,isSidebar:true})" } }, + // User Profile Modal + { + find: ",applicationRoleConnection:", + replacement: { + match: /#{intl::USER_PROFILE_MEMBER_SINCE}\),.{0,100}userId:(\i\.id),.{0,100}}\)}\),/, + replace: "$&,$self.FriendsSinceComponent({userId:$1,isSidebar:false})," + } + }, // User Profile Modal v2 { find: ".MODAL_V2,onClose:", diff --git a/src/plugins/ignoreActivities/index.tsx b/src/plugins/ignoreActivities/index.tsx index 39b84e88e..b5b8e64da 100644 --- a/src/plugins/ignoreActivities/index.tsx +++ b/src/plugins/ignoreActivities/index.tsx @@ -256,11 +256,8 @@ export default definePlugin({ { find: "#{intl::SETTINGS_GAMES_TOGGLE_OVERLAY}", replacement: { - // let { ... nowPlaying: a = !1 ... - // let { overlay: b ... } = Props ... - // ToggleOverLayButton(), nowPlaying && ... RemoveGameButton() - match: /\.Fragment,\{children:.+?,\i\(\),(?<=nowPlaying:(\i)=!1,.+?overlay:\i,[^}]+?\}=(\i).+?)(?=\1&&)/, - replace: (m, nowPlaying, props) => `${m}$self.renderToggleGameActivityButton(${props},${nowPlaying}),`, + match: /(\i)&&!\i\|\|\i\?null(?<=return (\i)\.verified.+?)/, + replace: "$self.renderToggleGameActivityButton($2,$1),$&" } }, @@ -268,8 +265,8 @@ export default definePlugin({ { find: "#{intl::EMBEDDED_ACTIVITIES_DEVELOPER_ACTIVITY}", replacement: { - match: /,rendersPlaceholder:.+?children:\i.*?}\),(?<=application:(\i).+?)/, - replace: (m, props) => `${m}$self.renderToggleActivityButton(${props}),` + match: /lineClamp:1.{0,50}?(?=!\i&&\i\?.+?application:(\i))/, + replace: "$&$self.renderToggleActivityButton($1)," } } ], diff --git a/src/plugins/imageZoom/index.tsx b/src/plugins/imageZoom/index.tsx index 67c084d84..670d806ac 100644 --- a/src/plugins/imageZoom/index.tsx +++ b/src/plugins/imageZoom/index.tsx @@ -162,7 +162,7 @@ export default definePlugin({ patches: [ { - find: "useFullWidth:!0,shouldLink:", + find: ".renderLinkComponent)?", replacement: [ { match: /useFullWidth:!0,shouldLink:/, diff --git a/src/plugins/messageLogger/index.tsx b/src/plugins/messageLogger/index.tsx index 823bdbde5..304f65453 100644 --- a/src/plugins/messageLogger/index.tsx +++ b/src/plugins/messageLogger/index.tsx @@ -752,7 +752,7 @@ export default definePlugin({ { // Attachment renderer - find: ".Types.ATTACHMENT,inline:", + find: "#{intl::REMOVE_ATTACHMENT_TOOLTIP_TEXT}", replacement: [ { match: /\.SPOILER,(?=\[\i\.\i\]:)/, @@ -779,7 +779,7 @@ export default definePlugin({ find: ".SEND_FAILED,", replacement: { // Render editHistory behind the message content - match: /\]:\i.isUnsupported.+?,children:\[/, + match: /\]:\i.isUnsupported.{0,20}?,children:\[/, replace: "$&arguments[0]?.message?.editHistory?.length>0&&$self.renderEdits(arguments[0])," } }, @@ -788,7 +788,7 @@ export default definePlugin({ find: "#{intl::MESSAGE_EDITED}", replacement: { // Make edit marker clickable - match: /(isInline:!1,children:.+?)"span",\{(?=className:)/, + match: /(isInline:!1,children:.{0,50}?)"span",\{(?=className:)/, replace: "$1$self.EditMarker,{message:arguments[0].message," } }, diff --git a/src/plugins/mutualGroupDMs/index.tsx b/src/plugins/mutualGroupDMs/index.tsx index 63b1adef0..08cb1bf41 100644 --- a/src/plugins/mutualGroupDMs/index.tsx +++ b/src/plugins/mutualGroupDMs/index.tsx @@ -35,8 +35,7 @@ const UserUtils = findByPropsLazy("getGlobalName"); const ProfileListClasses = findCssClassesLazy("empty", "textContainer", "connectionIcon"); const TabBarClasses = findCssClassesLazy("tabPanelScroller", "tabBarPanel"); const MutualsListClasses = findCssClassesLazy("row", "icon", "name", "details"); -// FIXME -const ExpandableList = findComponentByCodeLazy('"PRESS_SECTION"'); +const ExpandableList = findComponentByCodeLazy('action:"PRESS_SECTION"', "section"); function getGroupDMName(channel: Channel) { return channel.name || diff --git a/src/plugins/permissionsViewer/components/UserPermissions.tsx b/src/plugins/permissionsViewer/components/UserPermissions.tsx index 9028e7656..84930e35e 100644 --- a/src/plugins/permissionsViewer/components/UserPermissions.tsx +++ b/src/plugins/permissionsViewer/components/UserPermissions.tsx @@ -24,7 +24,7 @@ import { getIntlMessage } from "@utils/discord"; import { classes } from "@utils/misc"; import type { Guild, GuildMember, RoleOrUserPermission } from "@vencord/discord-types"; import { PermissionOverwriteType } from "@vencord/discord-types/enums"; -import { filters, findBulk, proxyLazyWebpack } from "@webpack"; +import { findCssClassesLazy } from "@webpack"; import { PermissionsBits, Tooltip, useMemo, UserStore } from "@webpack/common"; import { PermissionsSortOrder, settings } from ".."; @@ -39,14 +39,8 @@ interface UserPermission { type UserPermissions = Array; -const { RoleClasses, RoleBorderClasses } = proxyLazyWebpack(() => { - const [RoleClasses, RoleBorderClasses] = findBulk( - filters.byProps("role", "roleCircle", "roleName"), - filters.byProps("roleCircle", "dot", "dotBorderColor") - ) as Record[]; - - return { RoleClasses, RoleBorderClasses }; -}); +const RoleClasses = findCssClassesLazy("role", "roleName", "roleRemoveButton", "roleNameOverflow", "root"); +const RoleBorderClasses = findCssClassesLazy("roleCircle", "dot", "dotBorderColor"); interface FakeRoleProps extends React.HTMLAttributes { text: string; @@ -58,7 +52,7 @@ function FakeRole({ text, color, ...props }: FakeRoleProps) {
diff --git a/src/plugins/pictureInPicture/index.tsx b/src/plugins/pictureInPicture/index.tsx index 2fd44f979..ff8c00ebb 100644 --- a/src/plugins/pictureInPicture/index.tsx +++ b/src/plugins/pictureInPicture/index.tsx @@ -30,7 +30,7 @@ export default definePlugin({ { find: '["VIDEO","CLIP","AUDIO"]', replacement: { - match: /(\[\i>0&&\i\.length>0.+?children:)(\i.slice\(\i\))(?<=showDownload:(\i).+?isVisualMediaType:(\i).+?)/, + match: /(\[\i>0&&\i\.length>0.{0,150}?children:)(\i.slice\(\i\))(?<=showDownload:(\i).+?isVisualMediaType:(\i).+?)/, replace: (_, rest, origChildren, showDownload, isVisualMediaType) => `${rest}[${showDownload}&&${isVisualMediaType}&&$self.PictureInPictureButton(),...${origChildren}]` } } diff --git a/src/plugins/pinDms/index.tsx b/src/plugins/pinDms/index.tsx index 090533bdf..7e6f32148 100644 --- a/src/plugins/pinDms/index.tsx +++ b/src/plugins/pinDms/index.tsx @@ -96,7 +96,7 @@ export default definePlugin({ replace: "$&if($self.isCategoryIndex($1.section))return $self.renderCategory($1);" }, { - match: /"renderSection".+?"span",{/, + match: /"renderSection".{0,300}?"span",{/, replace: "$&...$self.makeSpanProps()," }, diff --git a/src/plugins/plainFolderIcon/index.ts b/src/plugins/plainFolderIcon/index.ts index 84390e22e..d7f0bd622 100644 --- a/src/plugins/plainFolderIcon/index.ts +++ b/src/plugins/plainFolderIcon/index.ts @@ -32,13 +32,8 @@ export default definePlugin({ replacement: [ { // Discord always renders both plain and guild icons folders and uses a css transtion to switch between them - // let {hovered: h, sorting: s} = props; - // hasFolderButtonContent = h && s; - // ... - // className: cn({[_1]: hasFolderButtonContent, [_2]: !hasFolderButtonContent}), - // children: [!hasFolderButtonContent && ...] - match: /className:\i\(\)\(\{\[\i\.\i\]:(\i),\[\i\.\i\]:!\1(?=.{0,30}children:\[!\i&&)/, - replace: (m, hasFolderButtonContent) => `${m},"vc-plainFolderIcon-plain":${hasFolderButtonContent}` + match: /\.slice\(0,4\).+?\]:(\i),\[\i\.\i\]:!\1/, + replace: (m, hasFolderButtonContent) => `${m},"vc-plainFolderIcon-plain":!${hasFolderButtonContent}` } ] diff --git a/src/plugins/roleColorEverywhere/index.tsx b/src/plugins/roleColorEverywhere/index.tsx index 8afa23a78..70d748f9a 100644 --- a/src/plugins/roleColorEverywhere/index.tsx +++ b/src/plugins/roleColorEverywhere/index.tsx @@ -107,8 +107,8 @@ export default definePlugin({ find: 'tutorialId:"whos-online', replacement: [ { - match: /(?<=\}\):null,).{0,100}— ",\i\]\}\)\]/, - replace: "$self.RoleGroupColor(arguments[0])]" + match: /(#{intl::CHANNEL_MEMBERS_A11Y_LABEL}.+}\):null,).{0,100}?— ",\i\]\}\)\]/, + replace: (_, rest) => `${rest}$self.RoleGroupColor(arguments[0])]` }, ], predicate: () => settings.store.memberList @@ -128,8 +128,8 @@ export default definePlugin({ find: "#{intl::GUEST_NAME_SUFFIX})]", replacement: [ { - match: /#{intl::GUEST_NAME_SUFFIX}\)\].+?\](?=\}\).*?userId:(\i\.id),contextGuildId:(\i))/, - replace: "$&,style:$self.getColorStyle($1,$2)," + match: /#{intl::GUEST_NAME_SUFFIX}.{0,50}?"".{0,50}\](?=\}\))(?<=guildId:(\i),.{0,50}?user:(\i).+?)/, + replace: "$&,style:$self.getColorStyle($2.id,$1)," } ], predicate: () => settings.store.voiceUsers @@ -147,7 +147,7 @@ export default definePlugin({ { find: ",reactionVoteCounts", replacement: { - match: /className:\i\.\i,(?="aria-label".{0,200}usernameClass)/, + match: /\.SIZE_32.+?variant:"text-md\/normal",className:\i\.\i,(?="aria-label":)/, replace: "$&style:$self.getColorStyle(arguments[0]?.user?.id,arguments[0]?.channel?.id)," }, predicate: () => settings.store.pollResults @@ -156,7 +156,7 @@ export default definePlugin({ { find: ".SEND_FAILED,", replacement: { - match: /(?<=\]:(\i)\.isUnsupported.+?,)(?=children:\[)/, + match: /(?<=\]:(\i)\.isUnsupported.{0,50}?,)(?=children:\[)/, replace: "style:$self.useMessageColorsStyle($1)," }, predicate: () => settings.store.colorChatMessages diff --git a/src/plugins/showHiddenChannels/index.tsx b/src/plugins/showHiddenChannels/index.tsx index ea2636583..5b3bf3f6d 100644 --- a/src/plugins/showHiddenChannels/index.tsx +++ b/src/plugins/showHiddenChannels/index.tsx @@ -196,12 +196,12 @@ export default definePlugin({ replacement: [ // Make the channel appear as muted if it's hidden { - match: /Children\.count.+?;(?=return\(0,\i\.jsxs?\))(?<={channel:(\i),name:\i,muted:(\i).+?;)/, + match: /Children\.count.+?;(?=return\(0,\i\.jsxs?\)\(\i\.\i,{focusTarget:)(?<={channel:(\i),name:\i,muted:(\i).+?;)/, replace: (m, channel, muted) => `${m}${muted}=$self.isHiddenChannel(${channel})?true:${muted};` }, // Make voice channels also appear as muted if they are muted { - match: /(?<=\?\i\.\i:\i\.\i,)(.+?)if\((\i)(?:\)return |\?)(\i\.MUTED)/, + match: /(?<=\?\i\.\i:\i\.\i,)(.{0,150}?)if\((\i)(?:\)return |\?)(\i\.MUTED)/, replace: (_, otherClasses, isMuted, mutedClassExpression) => `${isMuted}?${mutedClassExpression}:"",${otherClasses}if(${isMuted})return ""` } ] @@ -216,7 +216,7 @@ export default definePlugin({ }, { // Hide unreads - match: /Children\.count.+?;(?=return\(0,\i\.jsxs?\))(?<={channel:(\i),name:\i,.+?unread:(\i).+?)/, + match: /Children\.count.+?;(?=return\(0,\i\.jsxs?\)\(\i\.\i,{focusTarget:)(?<={channel:(\i),name:\i,.+?unread:(\i).+?)/, replace: (m, channel, unread) => `${m}${unread}=$self.isHiddenChannel(${channel})?false:${unread};` } ] @@ -324,7 +324,7 @@ export default definePlugin({ }, { // Patch the header to only return allowed users and roles if it's a hidden channel or locked channel (Like when it's used on the HiddenChannelLockScreen) - match: /return\(0,\i\.jsxs?\)\(\i\.\i,{channelId:(\i)\.id(?=.+?(\(0,\i\.jsxs?\)\("div",{className:\i\.\i,children:\[function.+?\]}\)),)/, + match: /return\(0,\i\.jsxs?\)\(\i\.\i,{channelId:(\i)\.id(?=.+?(\(0,\i\.jsxs?\)\("div",{className:\i\.\i,children:\[.{0,100}\i\.length>0.+?\]}\)),)/, replace: (m, channel, allowedUsersAndRolesComponent) => `if($self.isHiddenChannel(${channel},true)){return${allowedUsersAndRolesComponent};}${m}` }, { @@ -391,7 +391,7 @@ export default definePlugin({ }, { // Disable bad CSS class which mess up hidden voice channels styling - match: /(?=\i\|\|\i!==\i\.\i\.FULL_SCREEN)/, + match: /(?=\i\|\|\i!==\i\.\i\.FULL_SCREEN.{0,100}?this\._callContainerRef)/, replace: '$&!this.props.inCall&&$self.isHiddenChannel(this.props.channel,true)?"":' } ] @@ -431,7 +431,7 @@ export default definePlugin({ }, { // Remove the open chat button for the HiddenChannelLockScreen - match: /(?<=onClick:.{0,70}?toggleParticipantsList.{0,150}?\),!\i&&)\(0,\i\.jsxs?\).{0,280}iconClassName/, + match: /(?<="participants-list-button"\),!\i&&)\(0,\i\.jsxs?\).{0,280}?iconClassName:/, replace: "!$self.isHiddenChannel(arguments[0]?.channel,true)&&$&" } ] @@ -461,7 +461,7 @@ export default definePlugin({ }, }, { - find: 'className:"channelMention",children', + find: 'className:"channelMention",children:', replacement: { // Show inside voice channel instead of trying to join them when clicking on a channel mention match: /(?<=getChannel\(\i\);null!=(\i))(?=.{0,100}?selectVoiceChannel)/, diff --git a/src/plugins/showHiddenThings/index.ts b/src/plugins/showHiddenThings/index.ts index 9d51d9747..b788a8bd1 100644 --- a/src/plugins/showHiddenThings/index.ts +++ b/src/plugins/showHiddenThings/index.ts @@ -72,8 +72,8 @@ export default definePlugin({ find: "#{intl::GUILD_MEMBER_MOD_VIEW_HIGHEST_ROLE}),children:", predicate: () => settings.store.showModView, replacement: { - match: /(?<=#{intl::GUILD_MEMBER_MOD_VIEW_HIGHEST_ROLE}.{0,80})role:\i(?<=\[\i\.roles,\i\.highestRoleId,(\i)\].+)/, - replace: "role:$self.getHighestRole(arguments[0])", + match: /(#{intl::GUILD_MEMBER_MOD_VIEW_HIGHEST_ROLE}.{0,80})role:\i(?<=\[\i\.roles,\i\.highestRoleId,(\i)\].+?)/, + replace: (_, rest, roles) => `${rest}role:$self.getHighestRole(arguments[0],${roles})`, } }, // allows you to open mod view on yourself diff --git a/src/plugins/sortFriendRequests/index.tsx b/src/plugins/sortFriendRequests/index.tsx index c079597bc..27efd88c6 100644 --- a/src/plugins/sortFriendRequests/index.tsx +++ b/src/plugins/sortFriendRequests/index.tsx @@ -79,7 +79,7 @@ export default definePlugin({ find: "#{intl::FRIEND_REQUEST_CANCEL}", replacement: { predicate: () => settings.store.showDates, - match: /(?<=\.\i,children:\[)\(0,.+?(?=,\(0)(?<=user:(\i).+?)/, + match: /(?<=children:\[)\(0,.{0,100}user:\i,hovered:\i.+?(?=,\(0)(?<=user:(\i).+?)/, replace: (children, user) => `$self.WrapperDateComponent({user:${user},children:${children}})` } } diff --git a/src/plugins/themeAttributes/index.ts b/src/plugins/themeAttributes/index.ts index ab3082844..74a67fd0c 100644 --- a/src/plugins/themeAttributes/index.ts +++ b/src/plugins/themeAttributes/index.ts @@ -28,10 +28,10 @@ export default definePlugin({ // Add data-author-id and data-is-self to all messages { - find: ".referencedUsernameProfile,referencedAvatarProfile:", + find: "Message must not be a thread starter message", replacement: { - match: /\.\i(?=,"aria-setsize":-1,children:.+?#{intl::MESSAGE_A11Y_ROLE_DESCRIPTION})/, - replace: "$&,...$self.getMessageProps(arguments[0])" + match: /"aria-setsize":-1,(?=.{0,150}?#{intl::MESSAGE_A11Y_ROLE_DESCRIPTION})/, + replace: "...$self.getMessageProps(arguments[0]),$&" } }, diff --git a/src/plugins/userVoiceShow/index.tsx b/src/plugins/userVoiceShow/index.tsx index 3b1b78f4f..ec97530e5 100644 --- a/src/plugins/userVoiceShow/index.tsx +++ b/src/plugins/userVoiceShow/index.tsx @@ -70,7 +70,7 @@ export default definePlugin({ { find: "null!=this.peopleListItemRef.current", replacement: { - match: /className:\i\.\i,children:\[(?<=isFocused:(\i).+?isProvisional.{0,50})/, + match: /\.isProvisional.{0,50}?className:\i\.\i,children:\[(?<=isFocused:(\i).+?)/, replace: "$&$self.VoiceChannelIndicator({userId:this?.props?.user?.id,isActionButton:true,shouldHighlight:$1})," }, predicate: () => settings.store.showInMemberList diff --git a/src/plugins/viewIcons/index.tsx b/src/plugins/viewIcons/index.tsx index 10d484b23..ee2a29493 100644 --- a/src/plugins/viewIcons/index.tsx +++ b/src/plugins/viewIcons/index.tsx @@ -198,16 +198,16 @@ export default definePlugin({ { find: "imageClassName:null!=", replacement: { - match: /(?<=\("div",\i\(\i\(\{\},\i\),)(\{className:)/, - replace: '{style:{cursor:"pointer"},onClick:()=>$self.openAvatar($self.getAvatarUrl(arguments[0].user)),className:' + match: /avatarSrc:(\i),eventHandlers:(\i).+?"div",.{0,100}className:\i,/, + replace: "$&style:{cursor:\"pointer\"},onClick:()=>{$self.openAvatar($1)},", } }, // Banners { find: 'backgroundColor:"COMPLETE"', replacement: { - match: /(?<=!1\),)style:{(?=.+?backgroundImage:null!=(\i)\?"url\("\.concat\(\1,)/, - replace: (_, bannerSrc) => `onClick:()=>${bannerSrc}!=null&&$self.openBanner(${bannerSrc}),style:{cursor:${bannerSrc}!=null?"pointer":void 0,` + 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,` } }, // Group DMs top small & large icon @@ -235,9 +235,5 @@ export default definePlugin({ replace: (_, avatarUrl) => `onClick:()=>$self.openAvatar(${avatarUrl}),` } } - ], - - getAvatarUrl(user: User) { - return IconUtils.getUserAvatarURL(user, true); - }, + ] }); diff --git a/src/plugins/voiceDownload/index.tsx b/src/plugins/voiceDownload/index.tsx index f33e5e264..19d0883f5 100644 --- a/src/plugins/voiceDownload/index.tsx +++ b/src/plugins/voiceDownload/index.tsx @@ -15,7 +15,7 @@ export default definePlugin({ authors: [Devs.puv], patches: [ { - find: "VOICE_MESSAGE_PLAYBACK_STARTED,{src:", + find: "#{intl::LgCPMt::raw}", replacement: { match: /(?<=onVolumeHide:\i\}\))/, replace: ",$self.renderDownload(arguments[0].src)"