fix(FakeNitro): more reliable patches (#304)

This commit is contained in:
Justice Almanzar 2022-12-08 22:32:16 -05:00 committed by GitHub
parent f2e0542614
commit ebb8da0f23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -71,8 +71,8 @@ export default definePlugin({
"canUseEmojisEverywhere" "canUseEmojisEverywhere"
].map(func => { ].map(func => {
return { return {
match: new RegExp(`${func}:function\\(.+?}`), match: new RegExp(`${func}:function\\(.+?\\{`),
replace: `${func}:function(e){return true;}` replace: "$&return true;"
}; };
}) })
}, },
@ -80,8 +80,8 @@ export default definePlugin({
find: "canUseAnimatedEmojis:function", find: "canUseAnimatedEmojis:function",
predicate: () => Settings.plugins.FakeNitro.enableStickerBypass === true, predicate: () => Settings.plugins.FakeNitro.enableStickerBypass === true,
replacement: { replacement: {
match: /canUseStickersEverywhere:function\(.+?}/, match: /canUseStickersEverywhere:function\(.+?\{/,
replace: "canUseStickersEverywhere:function(e){return true;}" replace: "$&return true;"
}, },
}, },
{ {
@ -101,8 +101,8 @@ export default definePlugin({
"canStreamMidQuality" "canStreamMidQuality"
].map(func => { ].map(func => {
return { return {
match: new RegExp(`${func}:function\\(.+?}`), match: new RegExp(`${func}:function\\(.+?\\{`),
replace: `${func}:function(e){return true;}` replace: "$&return true;"
}; };
}) })
}, },