mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-15 01:23:03 -04:00
Add nitro bypass (#4)
This commit is contained in:
parent
a7ccbcfca4
commit
c3ff092162
11 changed files with 204 additions and 42 deletions
28
src/plugins/apiMessageEvents.ts
Normal file
28
src/plugins/apiMessageEvents.ts
Normal file
|
@ -0,0 +1,28 @@
|
|||
import definePlugin from "../utils/types";
|
||||
|
||||
export default definePlugin({
|
||||
name: "MessageEventsAPI",
|
||||
description: "Api required by anything using message events.",
|
||||
author: "ArjixWasTaken",
|
||||
patches: [
|
||||
{
|
||||
find: "sendMessage:function",
|
||||
replacement: [{
|
||||
match: /(?<=sendMessage:function\(.{1,2},.{1,2},.{1,2},.{1,2}\)){/,
|
||||
replace: "{Vencord.Api.MessageEvents._handlePreSend(...arguments);"
|
||||
}, {
|
||||
match: /(?<=editMessage:function\(.{1,2},.{1,2},.{1,2}\)){/,
|
||||
replace: "{Vencord.Api.MessageEvents._handlePreEdit(...arguments);"
|
||||
}]
|
||||
},
|
||||
{
|
||||
find: "if(e.altKey){",
|
||||
replacement: {
|
||||
match: /\.useClickMessage=function\((.{1,2}),(.{1,2})\).+?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});`
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue