-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRST-Bypass.plugin.js
162 lines (152 loc) · 4.73 KB
/
RST-Bypass.plugin.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
/**
* @name RST-Bypass
* @author MrRangerYT
* @authorId 737323631117598811
* @version 5.2
* @description RST-Bypass
* @website https://vk.com/mrrangeryt
* @source https://github.com/mrranger/RST-Bypass
* @updateUrl https://raw.githubusercontent.com/mrranger/RST-Bypass/master/RST-Bypass.plugin.js
*/
module.exports = (() => {
const config = {
info: {
name: "RST-Bypass",
authors: [
{
name: "MrRangerYT",
discord_id: "265508941818101769",
github_username: "mrranger",
},
],
version: "5.2",
description:
"Bypass nitro, обновлений скорее всего не будет, а там хз",
github: "https://github.com/mrranger/RST-Bypass",
github_raw:
"https://raw.githubusercontent.com/mrranger/RST-Bypass/master/RST-Bypass.plugin.js",
},
main: "RST-Bypass.plugin.js",
};
return !global.ZeresPluginLibrary
? class {
constructor() {
this._config = config;
}
getName() {
return config.info.name;
}
getAuthor() {
return config.info.authors.map((a) => a.name).join(", ");
}
getDescription() {
return config.info.description;
}
getVersion() {
return config.info.version;
}
load() {
BdApi.showConfirmationModal(
"Библиотека отсутствует",
`Отсутствует подключаемый модуль библиотеки, необходимый для ${config.info.name} Нажмите «Загрузить сейчас», чтобы установить его`,
{
confirmText: "Скачать сейчас",
cancelText: "Отмена",
onConfirm: () => {
require("request").get(
"https://rauenzi.github.io/BDPluginLibrary/release/0PluginLibrary.plugin.js",
async (error, response, body) => {
if (error)
return require("electron").shell.openExternal(
"https://betterdiscord.net/ghdl?url=https://raw.githubusercontent.com/rauenzi/BDPluginLibrary/master/release/0PluginLibrary.plugin.js"
);
await new Promise((r) =>
require("fs").writeFile(
require("path").join(
BdApi.Plugins.folder,
"0PluginLibrary.plugin.js"
),
body,
r
)
);
}
);
},
}
);
}
start() {}
stop() {}
}
: (([Plugin, Api]) => {
const plugin = (Plugin, Api) => {
const { Patcher, DiscordModules, Settings, PluginUtilities } = Api;
return class NitroEmoteAndScreenShareBypass extends Plugin {
settings = PluginUtilities.loadSettings(this.getName(), {
size: 48,
});
getSettingsPanel() {
return Settings.SettingPanel.build(
(_) =>
PluginUtilities.saveSettings(this.getName(), this.settings),
...[
new Settings.Slider(
"Размер эмодзи",
"Выберите размер смайликов.",
16,
128,
this.settings.size,
(size) => (this.settings.size = size),
{
markers: [16, 20, 32, 48, 64, 128],
stickToMarkers: true,
}
),
]
);
}
onStart() {
// подделка премиум на стороне клиента
let tries = 1;
let intervalId = setInterval(() => {
if (++tries > 5) clearInterval(intervalId);
const user =
ZeresPluginLibrary.DiscordModules.UserStore.getCurrentUser();
if (!user) return;
user.premiumType = 2;
clearInterval(intervalId);
}, 1000);
Patcher.before(
DiscordModules.MessageActions,
"sendMessage",
(_, [, message]) => {
const emojis = message.validNonShortcutEmojis;
emojis.forEach((emoji) => {
// пропустить дискорд смайлики
if (!emoji.require_colons) return;
// создайте строку смайликов, которую мы заменим
const emojiString = `<${emoji.animated ? "a" : ""}:${
emoji.name
}:${emoji.id}>`;
let url = emoji.url;
// изменить размер смайлов в URL
const size = this.settings.size;
if (size != 48) {
url = url.replace(/\?size=[0-9]+/, `?size=${size}`);
}
// замените сообщение, содержащее смайлик, на URL-адрес
message.content = message.content.replace(emojiString, url);
});
}
);
}
onStop() {
Patcher.unpatchAll();
}
};
};
return plugin(Plugin, Api);
})(global.ZeresPluginLibrary.buildPlugin(config));
})();
/*@end@*/