aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/apiMessageEvents.ts
diff options
context:
space:
mode:
authorVendicated <vendicated@riseup.net>2022-09-27 14:34:57 +0200
committerVendicated <vendicated@riseup.net>2022-09-27 14:34:57 +0200
commit6398dd25d20e6bc3e02425b709233066baf64e0c (patch)
tree3502593fdb4912c678ce6e840726114ccdb8c218 /src/plugins/apiMessageEvents.ts
parentd0940a8b194805173dae029d0fe284974ffecc7a (diff)
downloadVencord-6398dd25d20e6bc3e02425b709233066baf64e0c.tar.gz
Vencord-6398dd25d20e6bc3e02425b709233066baf64e0c.tar.bz2
Vencord-6398dd25d20e6bc3e02425b709233066baf64e0c.zip
Unbrick Vencord - Pt 1
Diffstat (limited to 'src/plugins/apiMessageEvents.ts')
-rw-r--r--src/plugins/apiMessageEvents.ts8
1 files changed, 4 insertions, 4 deletions
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});`
}
}
]