Merge branch 'pr-3925' into dev

This commit is contained in:
thororen1234 2026-01-23 15:54:04 -05:00
commit a6ba94a998
No known key found for this signature in database
6 changed files with 17 additions and 26 deletions

View file

@ -27,7 +27,7 @@ export default definePlugin({
{
find: "#{intl::DISCODO_DISABLED}",
replacement: {
match: /(?<=#{intl::DISCODO_DISABLED}.+?return)(\(.{0,150}?tutorialId:.+?}\))(?=}function)/,
match: /(?<=#{intl::DISCODO_DISABLED}.+?return)(\(.{0,150}?tutorialId:"friends-list".+?}\))(?=}function)/,
replace: "[$1].concat(Vencord.Api.ServerList.renderAll(Vencord.Api.ServerList.ServerListRenderPosition.Above))"
}
},

View file

@ -133,14 +133,14 @@ export default definePlugin({
replace: "$&.replace(/^./, c => c.toUpperCase())"
},
{
match: /,\i\.\i\),.+?(?=null!=(\i)&&(.{0,20}\i\.Text.{0,200}?,children:).{0,15}?("span"),({className:\i\.\i,children:\["Build Override: ",\1\.id\]\})\)\}\))/,
match: /"text-xxs\/normal".+?(?=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: /"data-mtctest.+?\[\(0,\i\.jsxs?\)\((.{1,10}),(\{[^{}}]+\{.{0,20}.\i,.{0,50}\})\)," "/,
match: /"text-xs\/normal".+?\[\(0,\i\.jsxs?\)\((.{1,10}),(\{[^{}}]+\{.{0,20}className:\i.\i,.+?\})\)," "/,
replace: (m, component, props) => {
props = props.replace(/children:\[.+\]/, "");
return `${m},$self.makeInfoElements(${component},${props})`;
@ -171,8 +171,8 @@ export default definePlugin({
find: "#{intl::USER_SETTINGS_ACTIONS_MENU_LABEL}",
replacement: {
// Skip the check Discord performs to make sure the section being selected in the user settings context menu is valid
match: /void\(null!=\(\i=Object.values\(\i\.\i\).+?&&(?=\(0,\i\.openUserSettings\)\(\i,\{section:\i)/,
replace: "("
match: /null!=\(\i=Object.values\(\i\.\i\).{0,50}?&&(?=\(0,\i\.openUserSettings\)\(\i,\{section:\i)/,
replace: ""
}
},
{

View file

@ -184,10 +184,7 @@ export default definePlugin({
},
// If we are rendering the Better Folders sidebar, we filter out everything but the Guild List from the Sidebar children
{
// match the bottom (NEW) footer
// both the top and bottom one use barClassName
// so we match the call to classNames that's only in the bottom one
match: /\}\),barClassName:.+?\}\)\]/,
match: /reverse:!0,.+?barClassName:.+?\}\)\]/,
replace: "$&.filter($self.makeGuildsBarSidebarFilter(!!arguments[0]?.isBetterFolders))"
}
]
@ -233,20 +230,20 @@ export default definePlugin({
// If we are rendering the normal GuildsBar sidebar, we avoid rendering guilds from folders that are expanded
{
predicate: () => !settings.store.keepIcons,
match: /(?=\i\(\(\i,\i,\i\)=>{let{key:.{0,70}"ul")(?<=selected:\i,expanded:(\i),.+?)/,
replace: (_, isExpanded) => `$self.shouldRenderContents(arguments[0],${isExpanded})?null:`
match: /"--custom-folder-color".+?(?=\i\(\(\i,\i,\i\)=>{let{key:.{0,70}"ul")(?<=selected:\i,expanded:(\i),.+?)/,
replace: (m, isExpanded) => `${m}$self.shouldRenderContents(arguments[0],${isExpanded})?null:`
},
// Decide if we should render the expanded folder background if we are rendering the Better Folders sidebar
{
predicate: () => settings.store.showFolderIcon !== FolderIconDisplay.Always,
match: /--custom-folder-color.{0,110}?children:\[/,
match: /"--custom-folder-color".{0,110}?children:\[/,
replace: "$&$self.shouldShowFolderIconAndBackground(!!arguments[0]?.isBetterFolders,arguments[0]?.betterFoldersExpandedIds)&&"
},
// Decide if we should render the expanded folder icon if we are rendering the Better Folders sidebar
{
predicate: () => settings.store.showFolderIcon !== FolderIconDisplay.Always,
match: /(?<="span",[^,]{0,50}?,)(?=\i,)/,
replace: "!$self.shouldShowFolderIconAndBackground(!!arguments[0]?.isBetterFolders,arguments[0]?.betterFoldersExpandedIds)?null:"
match: /"--custom-folder-color".+?className:\i\.\i}\),(?=\i,)/,
replace: "$&!$self.shouldShowFolderIconAndBackground(!!arguments[0]?.isBetterFolders,arguments[0]?.betterFoldersExpandedIds)?null:"
}
]
},

View file

@ -71,12 +71,12 @@ export default definePlugin({
},
{
match: /({variant:"text-sm\/medium",className:\i\.\i,children:.{70,110}{children:"\\xb7"}\),\(0,\i\.\i\)\("span",{children:)(\i\[\d+\])}/,
replace: "$1$self.renderTimestamp({ ...arguments[0], timeLabel: $2 })}"
replace: "$1$self.renderTimestamp({...arguments[0],timeLabel:$2})}"
},
// Replace the icon
{
match: /,\i\.\i\),children:\[(?<=,icon:(\i)\}.+?)/,
replace: "$& $self.renderIcon({ ...arguments[0], DeviceIcon: $1 }), false &&"
match: /children:\[(?=.{0,125}?width:"32")(?<=,icon:(\i)\}.+?)/,
replace: "children:[$self.renderIcon({...arguments[0],DeviceIcon:$1}),false&&"
}
]
}

View file

@ -160,13 +160,7 @@ export default definePlugin({
// Thus, we sanity check webpack modules
Layer(props: LayerProps) {
try {
// findCssClassesLazy returns an empty object if the classes aren't found
// so we have to explicitly test for the presence of classes
if (!Classes.layer?.length) {
new Logger("BetterSettings").error("Failed to find classes");
return props.children;
}
[FocusLock.$$vencordGetWrappedComponent(), ComponentDispatch].forEach(e => e.test);
[FocusLock.$$vencordGetWrappedComponent(), ComponentDispatch, Classes.layer].forEach(e => e.test);
} catch {
new Logger("BetterSettings").error("Failed to find some components");
return props.children;

View file

@ -52,8 +52,8 @@ export default definePlugin({
find: "}renderEmbeds(",
replacement: [
{
match: /\(\)\(\i,\i\.\i(?<=this.renderShareClientTheme\(.{0,250})/,
replace: "$&+(this.props.channel.nsfw? ' vc-nsfw-img': '')"
match: /(\.renderReactions\(\i\).+?className:)/,
replace: '$&(this.props.channel.nsfw?" vc-nsfw-img":"")+'
}
]
}