fix plugins that modify text (FakeNitro, TextReplace)
This commit is contained in:
parent
bff6b594c7
commit
bc680139be
1 changed files with 3 additions and 3 deletions
|
|
@ -37,9 +37,9 @@ export default definePlugin({
|
|||
{
|
||||
find: ".handleSendMessage,onResize:",
|
||||
replacement: {
|
||||
// https://regex101.com/r/7iswuk/1
|
||||
match: /let (\i)=\i\.\i\.parse\((\i),.+?\.getSendMessageOptions\(\{.+?\}\)?;(?=.+?(\i)\.flags=)(?<=\)\(({.+?})\)\.then.+?)/,
|
||||
replace: (m, parsedMessage, channel, options, props) => m +
|
||||
// TODO: simplify once Discord decides on if this .then() callback should be async or not
|
||||
match: /(?<=channel:\i\}\)\.then\()(?:async )?(\i=>.+?let (\i)=\i\.\i\.parse\((\i),.+?\.getSendMessageOptions\(\{.+?\}\)?;)(?=.+?(\i)\.flags=)(?<=\)\(({.+?})\)\.then.+?)/,
|
||||
replace: (m, restCode, parsedMessage, channel, options, props) => "async " + restCode +
|
||||
`if(await Vencord.Api.MessageEvents._handlePreSend(${channel}.id,${parsedMessage},${options},${props}))` +
|
||||
"return{shouldClear:false,shouldRefocus:true};"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue