diff --git a/src/plugins/_api/commands.ts b/src/plugins/_api/commands.ts index cca1a6862..2af65b6f9 100644 --- a/src/plugins/_api/commands.ts +++ b/src/plugins/_api/commands.ts @@ -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??" + } + ] } ], }); diff --git a/src/plugins/_api/messageEvents.ts b/src/plugins/_api/messageEvents.ts index ca38846ba..70b7f26c3 100644 --- a/src/plugins/_api/messageEvents.ts +++ b/src/plugins/_api/messageEvents.ts @@ -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};" diff --git a/src/utils/modal.tsx b/src/utils/modal.tsx index 2bff48f18..cad37afa4 100644 --- a/src/utils/modal.tsx +++ b/src/utils/modal.tsx @@ -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:"), diff --git a/src/webpack/common/components.ts b/src/webpack/common/components.ts index 57629cf7a..f44ba0343 100644 --- a/src/webpack/common/components.ts +++ b/src/webpack/common/components.ts @@ -60,7 +60,7 @@ export const TextInput = waitForComponent("TextInput", filters.comp export const TextArea = waitForComponent("TextArea", filters.componentByCode("this.getPaddingRight()},id:")); export const Select = waitForComponent("Select", filters.componentByCode('"Select"')); export const SearchableSelect = waitForComponent("SearchableSelect", filters.componentByCode('"SearchableSelect"')); -export const Slider = waitForComponent("Slider", filters.componentByCode("`markDash${null==")); +export const Slider = waitForComponent("Slider", filters.componentByCode("markDash", "this.renderMark(")); export const Popout = waitForComponent("Popout", filters.componentByCode("ref:this.ref,", "renderPopout:this.renderPopout,")); export const Dialog = waitForComponent("Dialog", filters.componentByCode('role:"dialog",tabIndex:-1')); export const TabBar = waitForComponent("TabBar", filters.componentByCode("ref:this.tabBarRef,className:"));