-
Notifications
You must be signed in to change notification settings - Fork 1
/
online.py
115 lines (100 loc) · 4.01 KB
/
online.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
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
import json
import random
import sys
import re
import threading
import time
import os
from concurrent.futures import ThreadPoolExecutor
import websocket
from colorama import Fore
from colorama import init, Fore, Back, Style
init(convert=True)
def online(token, game, type, status):
ws = websocket.WebSocket()
if status == "random":
stat = ['online', 'dnd', 'idle']
status = random.choice(stat)
ws.connect('wss://gateway.discord.gg/?v=6&encoding=json')
hello = json.loads(ws.recv())
heartbeat_interval = hello['d']['heartbeat_interval']
if type == "Playing":
gamejson = {
"name": game,
"type": 0
}
elif type == 'Streaming':
gamejson = {
"name": game,
"type": 1,
"url": "https://www.twitch.tv/discord.gg/AVKEJtWkBj"
}
elif type == "Listening":
gamejson = {
"name": game,
"type": 2
}
elif type == "Watching":
gamejson = {
"name": game,
"type": 3
}
auth = {
"op": 2,
"d": {
"token": token,
"properties": {
"$os": sys.platform,
"$browser": "RTB",
"$device": f"{sys.platform} Device"
},
"presence": {
"game": gamejson,
"status": status,
"since": 0,
"afk": False
}
},
"s": None,
"t": None
}
ws.send(json.dumps(auth))
ack = {
"op": 1,
"d": None
}
while True:
time.sleep(heartbeat_interval / 1000)
try:
ws.send(json.dumps(ack))
except Exception as e:
break
def main():
types = ['Playing', 'Streaming', 'Watching', 'Listening']
type = input(f'''
██████╗ ██████╗ ██████╗██╗ ██╗
██╔════╝██╔═══██╗██╔════╝██║ ██╔╝
██║ ██║ ██║██║ █████╔╝
██║ ██║ ██║██║ ██╔═██╗
╚██████╗╚██████╔╝╚██████╗██║ ██╗
╚═════╝ ╚═════╝ ╚═════╝╚═╝ ╚═╝
Options: Playing | Streaming | Watching | Listening
Your Choice > ''')
os.system("cls")
game = input(f'''
██████╗ ██████╗ ██████╗██╗ ██╗
██╔════╝██╔═══██╗██╔════╝██║ ██╔╝
██║ ██║ ██║██║ █████╔╝
██║ ██║ ██║██║ ██╔═██╗
╚██████╗╚██████╔╝╚██████╗██║ ██╗
╚═════╝ ╚═════╝ ╚═════╝╚═╝ ╚═╝
Info: Type what you want the status to be
Status > ''')
status = ['online', 'dnd', 'idle','random']
status = status[3]
executor = ThreadPoolExecutor(max_workers=1000)
for token in open("tokens.txt","r+").readlines():
threading.Thread(target=lambda : online(token.replace("\n",""), game, type, status)).start()
os.system("cls")
print(f"{Fore.LIGHTRED_EX}[{Fore.RESET}!{Fore.LIGHTRED_EX}]{Fore.RESET} Tokens Online")
main()