Fix MessageEventsAPI broken patch

This commit is contained in:
Nuckyz 2025-08-11 15:35:29 -03:00
parent 0c89314d49
commit d9e2732a8d
No known key found for this signature in database
GPG key ID: 440BF8296E1C4AD9

View file

@ -35,10 +35,10 @@ export default definePlugin({
}
},
{
find: ".handleSendMessage,onResize",
find: ".handleSendMessage,onResize:",
replacement: {
// https://regex101.com/r/hBlXpl/1
match: /let (\i)=\i\.\i\.parse\((\i),.+?let (\i)=\i\.\i\.getSendMessageOptions\(\{.+?\}\);(?<=\)\(({.+?})\)\.then.+?)/,
// https://regex101.com/r/7iswuk/1
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};"