aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/apiMessageEvents.ts
diff options
context:
space:
mode:
authorNuckyz <61953774+Nuckyz@users.noreply.github.com>2023-05-04 21:47:08 -0300
committerGitHub <noreply@github.com>2023-05-05 02:47:08 +0200
commit474932161fb6e50e90cbd4e1546255b6a520394e (patch)
tree9c62ec029314fbe8447ba85f5ef74e6870f4cc63 /src/plugins/apiMessageEvents.ts
parentbd95a25f4c111c3d0e2564fb1bfcf5b8e12e87de (diff)
downloadVencord-474932161fb6e50e90cbd4e1546255b6a520394e.tar.gz
Vencord-474932161fb6e50e90cbd4e1546255b6a520394e.tar.bz2
Vencord-474932161fb6e50e90cbd4e1546255b6a520394e.zip
Fix FakeNitro Stickers (#1048)
Diffstat (limited to 'src/plugins/apiMessageEvents.ts')
-rw-r--r--src/plugins/apiMessageEvents.ts12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/plugins/apiMessageEvents.ts b/src/plugins/apiMessageEvents.ts
index 1fe3623..fa46752 100644
--- a/src/plugins/apiMessageEvents.ts
+++ b/src/plugins/apiMessageEvents.ts
@@ -36,10 +36,14 @@ export default definePlugin({
{
find: ".handleSendMessage=",
replacement: {
- // checkIsMessageValid().then((function (isValidData) { ... getSendMessageOptionsForReply(data); ... sendMessage(channel.id, msg, void 0, mergeMessageSendOptions(...))
- match: /(?<=uploads:(\i),channel:\i\}\)\.then\(\()function\((\i)\)\{(var \i=\i\.valid.+?\.getSendMessageOptionsForReply\(\i\);)(?=.+?\.sendMessage\((\i)\.id,(\i),void 0,(\i\(.+?)\):)/,
- // checkIsMessageValid().then((async function (isValidData) { ...; if (await handlePresend(channel.id, msg, extra)) return; ...
- replace: "async function($2){$3 if (await Vencord.Api.MessageEvents._handlePreSend($4.id,$5,$6,$1)) return {shouldClear:true,shouldRefocus:true};"
+ // props.chatInputType...then((function(isMessageValid)... var parsedMessage = b.c.parse(channel,... var replyOptions = f.g.getSendMessageOptionsForReply(pendingReply);
+ // Lookbehind: validateMessage)({openWarningPopout:..., type: i.props.chatInputType, content: t, stickers: r, ...}).then((function(isMessageValid)
+ match: /(props\.chatInputType.+?\.then\(\()(function.+?var (\i)=\i\.\i\.parse\((\i),.+?var (\i)=\i\.\i\.getSendMessageOptionsForReply\(\i\);)(?<=\)\(({.+?})\)\.then.+?)/,
+ // props.chatInputType...then((async function(isMessageValid)... var replyOptions = f.g.getSendMessageOptionsForReply(pendingReply); if(await Vencord.api...) return { shoudClear:true, shouldRefocus:true };
+ replace: (_, rest1, rest2, parsedMessage, channel, replyOptions, extra) => "" +
+ `${rest1}async ${rest2}` +
+ `if(await Vencord.Api.MessageEvents._handlePreSend(${channel}.id,${parsedMessage},${extra},${replyOptions}))` +
+ "return{shoudClear:true,shouldRefocus:true};"
}
},
{