-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathVC.py
32 lines (30 loc) · 1.18 KB
/
VC.py
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
from json import loads
from time import sleep
from json import dumps
from websocket import WebSocket
from concurrent.futures import ThreadPoolExecutor
guild_id = input("Guild ID: ")
chid = input("Channel ID: ")
tokenlist = open("tokens.txt").read().splitlines()
executor = ThreadPoolExecutor(max_workers=int(1000000))
mute = False
deaf = False
def run(token) :
ws = WebSocket()
ws.connect("wss://gateway.discord.gg/?v=9&encoding=json")
hello = loads(ws.recv())
heartbeat_interval = hello['d']['heartbeat_interval']
ws.send(dumps({"op": 2,"d": {"token": token,"properties": {"$os": "windows","$browser": "Discord","$device": "desktop"}}}))
ws.send(dumps({"op": 4,"d": {"guild_id": guild_id,"channel_id": chid,"self_mute": mute,"self_deaf": deaf}}))
ws.send(dumps({"op": 18,"d": {"type": "guild","guild_id": guild_id,"channel_id": chid,"preferred_region": "singapore"}}))
while True:
sleep(heartbeat_interval/1000)
try:
ws.send(dumps({"op": 1,"d": None}))
except Exception:
break
i = 0
for token in tokenlist:
executor.submit(run, token)
i+=1
print("WebSocket Connected : {}".format(i))