From 6398dd25d20e6bc3e02425b709233066baf64e0c Mon Sep 17 00:00:00 2001 From: Vendicated Date: Tue, 27 Sep 2022 14:34:57 +0200 Subject: Unbrick Vencord - Pt 1 --- src/plugins/apiMessageEvents.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/plugins/apiMessageEvents.ts') diff --git a/src/plugins/apiMessageEvents.ts b/src/plugins/apiMessageEvents.ts index 79acd32..98144e2 100644 --- a/src/plugins/apiMessageEvents.ts +++ b/src/plugins/apiMessageEvents.ts @@ -8,20 +8,20 @@ export default definePlugin({ { find: "sendMessage:function", replacement: [{ - match: /(?<=sendMessage:function\(.{1,2},.{1,2},.{1,2},.{1,2}\)){/, + match: /(?<=_sendMessage:function\([^)]+\)){/, replace: "{Vencord.Api.MessageEvents._handlePreSend(...arguments);" }, { - match: /(?<=editMessage:function\(.{1,2},.{1,2},.{1,2}\)){/, + match: /(?<=\beditMessage:function\([^)]+\)){/, replace: "{Vencord.Api.MessageEvents._handlePreEdit(...arguments);" }] }, { find: "if(e.altKey){", replacement: { - match: /\.useClickMessage=function\((.{1,2}),(.{1,2})\).+?function\((.{1,2})\){/, + match: /var \w=(\w)\.id,\w=(\w)\.id;return .{1,2}\.useCallback\(\(?function\((.{1,2})\){/, replace: (m, message, channel, event) => // the message param is shadowed by the event param, so need to alias them - `${m.replace("{", `{var _msg=${message};var _chan=${channel};`)}Vencord.Api.MessageEvents._handleClick(_msg, _chan, ${event});` + `var _msg=${message},_chan=${channel};${m}Vencord.Api.MessageEvents._handleClick(_msg, _chan, ${event});` } } ] -- cgit