fix some things broken by a recent Discord update

This commit is contained in:
Vendicated 2026-02-05 04:02:36 +01:00
parent dc27c4da76
commit 577407bab9
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18
6 changed files with 18 additions and 11 deletions

View file

@ -51,11 +51,17 @@ export default definePlugin({
// Show plugin name instead of "Built-In"
{
find: "#{intl::COMMANDS_OPTIONAL_COUNT}",
replacement: {
// ...children: p?.name
match: /(?<=:(\i)\.displayDescription\}.{0,200}children:).{0,50}\.name(?=\}\))/,
replace: "$1.plugin||($&)"
}
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??"
}
]
}
],
});

View file

@ -29,7 +29,7 @@ export default definePlugin({
required: true,
patches: [
{
find: '"Menu API',
find: "Menu API only allows Items",
replacement: {
match: /function.{0,80}type===(\i\.\i)\).{0,50}navigable:.+?Menu API/s,
replace: (m, mod) => {

View file

@ -38,7 +38,7 @@ export default definePlugin({
find: ".handleSendMessage,onResize:",
replacement: {
// https://regex101.com/r/7iswuk/1
match: /let (\i)=\i\.\i\.parse\((\i),.+?\.getSendMessageOptions\(\{.+?\}\);(?=.+?(\i)\.flags=)(?<=\)\(({.+?})\)\.then.+?)/,
match: /let (\i)=\i\.\i\.parse\((\i),.+?\.getSendMessageOptions\(\{.+?\}\)?;(?=.+?(\i)\.flags=)(?<=\)\(({.+?})\)\.then.+?)/,
replace: (m, parsedMessage, channel, replyOptions, extra) => m +
`if(await Vencord.Api.MessageEvents._handlePreSend(${channel}.id,${parsedMessage},${extra},${replyOptions}))` +
"return{shouldClear:false,shouldRefocus:true};"

View file

@ -106,10 +106,10 @@ export default definePlugin({
},
// Enable experiment embed on sent experiment links
{
find: '"Clear Treatment "',
find: "Clear Treatment ",
replacement: [
{
match: /\i\.isStaff\(\)/,
match: /\i\??\.isStaff\(\)/,
replace: "true"
},
// Fix some tricky experiments name causing a client crash

View file

@ -101,7 +101,8 @@ interface Modals {
}>;
}
export const Modals: Modals = mapMangledModuleLazy(':"thin")', {
// TODO: move to new modal api
export const Modals: Modals = mapMangledModuleLazy(".MODAL_ROOT_LEGACY,", {
ModalRoot: filters.componentByCode('.MODAL,"aria-labelledby":'),
ModalHeader: filters.componentByCode(",id:"),
ModalContent: filters.componentByCode("scrollbarType:"),

View file

@ -60,7 +60,7 @@ export const TextInput = waitForComponent<t.TextInput>("TextInput", filters.comp
export const TextArea = waitForComponent<t.TextArea>("TextArea", filters.componentByCode("this.getPaddingRight()},id:"));
export const Select = waitForComponent<t.Select>("Select", filters.componentByCode('"Select"'));
export const SearchableSelect = waitForComponent<t.SearchableSelect>("SearchableSelect", filters.componentByCode('"SearchableSelect"'));
export const Slider = waitForComponent<t.Slider>("Slider", filters.componentByCode('"markDash".concat('));
export const Slider = waitForComponent<t.Slider>("Slider", filters.componentByCode("markDash", "this.renderMark("));
export const Popout = waitForComponent<t.Popout>("Popout", filters.componentByCode("ref:this.ref,", "renderPopout:this.renderPopout,"));
export const Dialog = waitForComponent<t.Dialog>("Dialog", filters.componentByCode('role:"dialog",tabIndex:-1'));
export const TabBar = waitForComponent("TabBar", filters.componentByCode("ref:this.tabBarRef,className:"));