aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjue131 <83157668+jue131@users.noreply.github.com>2022-10-21 20:37:53 +0900
committerGitHub <noreply@github.com>2022-10-21 13:37:53 +0200
commite93111fb67e415b0828418b23811152d7e4eee86 (patch)
treeabbf6db1c7d0522dc3d18e31e56a2221534c87fb
parentccf7f66a797c9583cf7d4a5a3c08ab6757dc0d70 (diff)
downloadVencord-e93111fb67e415b0828418b23811152d7e4eee86.tar.gz
Vencord-e93111fb67e415b0828418b23811152d7e4eee86.tar.bz2
Vencord-e93111fb67e415b0828418b23811152d7e4eee86.zip
Update nitroBypass.ts (#132)
-rw-r--r--src/plugins/nitroBypass.ts36
1 files changed, 34 insertions, 2 deletions
diff --git a/src/plugins/nitroBypass.ts b/src/plugins/nitroBypass.ts
index a013dd6..b01a484 100644
--- a/src/plugins/nitroBypass.ts
+++ b/src/plugins/nitroBypass.ts
@@ -1,8 +1,9 @@
import { addPreSendListener, addPreEditListener, removePreSendListener, removePreEditListener } from "../api/MessageEvents";
import { findByProps } from "../webpack";
-import definePlugin from "../utils/types";
+import definePlugin, { OptionType } from "../utils/types";
import { Devs } from "../utils/constants";
import { UserStore } from "../webpack/common";
+import { Settings } from "../Vencord";
export default definePlugin({
name: "NitroBypass",
@@ -12,9 +13,21 @@ export default definePlugin({
patches: [
{
find: "canUseAnimatedEmojis:function",
+ predicate: () => Settings.plugins.NitroBypass.enableEmojiBypass === true,
replacement: [
"canUseAnimatedEmojis",
- "canUseEmojisEverywhere",
+ "canUseEmojisEverywhere"
+ ].map(func => {
+ return {
+ match: new RegExp(`${func}:function\\(.+?}`),
+ replace: `${func}:function (e) { return true; }`
+ };
+ })
+ },
+ {
+ find: "canUseAnimatedEmojis:function",
+ predicate: () => Settings.plugins.NitroBypass.enableStreamQualityBypass === true,
+ replacement: [
"canUseHighVideoUploadQuality",
"canStreamHighQuality",
"canStreamMidQuality"
@@ -27,12 +40,27 @@ export default definePlugin({
},
{
find: "STREAM_FPS_OPTION.format",
+ predicate: () => Settings.plugins.NitroBypass.enableStreamQualityBypass === true,
replacement: {
match: /(userPremiumType|guildPremiumTier):.{0,10}TIER_\d,?/g,
replace: ""
}
}
],
+ options: {
+ enableEmojiBypass: {
+ description: "Allow sending fake emojis",
+ type: OptionType.BOOLEAN,
+ default: true,
+ restartNeeded: true,
+ },
+ enableStreamQualityBypass: {
+ description: "Allow streaming in nitro quality",
+ type: OptionType.BOOLEAN,
+ default: true,
+ restartNeeded: true,
+ }
+ },
get guildId() {
return window.location.href.split("channels/")[1].split("/")[0];
@@ -43,6 +71,10 @@ export default definePlugin({
},
start() {
+ if (!Settings.plugins.NitroBypass.enableEmojiBypass) {
+ return;
+ }
+
if (this.canUseEmotes) {
console.info("[NitroBypass] Skipping start because you have nitro");
return;