forked from oSumAtrIX/BetterDiscordPlugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNitroEmoteAndScreenShareBypass.plugin.js
78 lines (67 loc) · 2.93 KB
/
NitroEmoteAndScreenShareBypass.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
//META{"name":"NitroEmoteAndScreenShareBypass","source":"https://github.com/oSumAtrIX/BetterDiscordPlugins","website":"https://github.com/oSumAtrIX"}*//
class NitroEmoteAndScreenShareBypass {
getName() {
return "NitroEmoteAndScreenShareBypass";
}
getDescription() {
return "Send nitro emotes (lame bypass) and enable high quality screen sharing without Nitro";
}
getVersion() {
return "3.5";
}
getAuthor() {
return "oSumAtrIX";
}
stop() {
}
start() {
const mod = BdApi.findModuleByProps("getCurrentUser")
let tries;
const checkExist = setInterval(() => {
let cUser;
if ((cUser = mod.getCurrentUser()) != undefined) {
cUser.premiumType = 2;
tries = 10;
}
if (++tries > 10)
clearInterval(checkExist);
}, 1000);
}
onSwitch() {
const
useFileUpload = false,
div = document.getElementsByClassName("name-3YKhmS")[0],
serverName = div != undefined ? div.innerHTML : "noServer",
btnContainer = document.getElementsByClassName("buttons-3JBrkn")[0].children,
btn = btnContainer[btnContainer.length - 1];
if (btn != null)
btn.onclick = () => {
const checkExist = setInterval(function() {
const scroller = document.getElementsByClassName("listItems-1uJgMC")[0];
if (scroller == null) return;
clearInterval(checkExist);
scroller.parentElement.onclick = (e) => {
const
target = e.target,
src = target.firstChild.src;
if (src.slice(-7, -4) == "gif" || target.parentElement.parentElement.children[0].firstChild.children[1].innerHTML != serverName) {
const curChannel = BdApi.findModuleByProps("getLastSelectedChannelId").getChannelId();
var url = src.slice(0, -4);
var ext = url.slice(url.length - 3);
function upLoad(blob) {
BdApi.findModuleByProps("instantBatchUpload").instantBatchUpload(curChannel, [new File([blob], 'oSumAtrIX.' + ext, blob)]);
}
var txtBar = document.getElementsByClassName("textArea-12jD-V")[0];
url = url + "?size=40";
useFileUpload ?
fetch(url)
.then(res => res.blob()).then(upLoad) :
BdApi.findModuleByProps("sendMessage").sendMessage(curChannel, {
content: url
});
}
}
}, 100);
}
}
}