This commit is contained in:
Nuckyz 2026-01-23 20:31:11 -03:00
parent 597c7414b1
commit aa8de734d6
No known key found for this signature in database
GPG key ID: 440BF8296E1C4AD9
8 changed files with 20 additions and 25 deletions

View file

@ -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: /\.slice\(0,4\).+?\]:(\i),\[\i\.\i\]:!\1/,
replace: (m, hasFolderButtonContent) => `${m},"vc-plainFolderIcon-plain":!${hasFolderButtonContent}`
replace: (m, hasFolderButtonContent) => `${m},"vc-plainFolderIcon-plain":${hasFolderButtonContent}`
}
]

View file

@ -106,8 +106,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
@ -127,7 +127,7 @@ export default definePlugin({
find: "#{intl::GUEST_NAME_SUFFIX})]",
replacement: [
{
match: /#{intl::GUEST_NAME_SUFFIX}\)\].+?\](?<=guildId:(\i),.+?user:(\i).+?)/,
match: /#{intl::GUEST_NAME_SUFFIX}.+?""\](?<=guildId:(\i),.+?user:(\i).+?)/,
replace: "$&,style:$self.getColorStyle($2.id,$1),"
}
],
@ -146,7 +146,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

View file

@ -166,7 +166,7 @@ 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};`
},
// Add the hidden eye icon if the channel is hidden
@ -176,7 +176,7 @@ export default definePlugin({
},
// 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 ""`
}
]
@ -193,7 +193,7 @@ export default definePlugin({
{
// Hide unreads
predicate: () => settings.store.hideUnreads === true,
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};`
}
]
@ -301,7 +301,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}`
},
{
@ -368,7 +368,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)?"":'
}
]
@ -408,7 +408,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)&&$&"
}
]
@ -438,7 +438,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)/,

View file

@ -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) => `${rest}role:$self.getHighestRole(arguments[0])`,
}
},
// allows you to open mod view on yourself

View file

@ -65,7 +65,7 @@ export default definePlugin({
find: "#{intl::FRIEND_REQUEST_CANCEL}",
replacement: {
predicate: () => settings.store.showDates,
match: /(?<=\.\i,children:\[)\(0,.+?(?=,\(0)(?<=user:(\i).+?)/,
match: /(?<=\.\i,children:\[)\(0,.{0,100}user:\i,hovered:\i+?(?=,\(0)(?<=user:(\i).+?)/,
replace: (children, user) => `$self.WrapperDateComponent({user:${user},children:${children}})`
}
}],

View file

@ -29,10 +29,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]),$&"
}
},

View file

@ -87,7 +87,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

View file

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