-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathx-spammer.py
110 lines (93 loc) · 2.92 KB
/
x-spammer.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
import requests, json, threading, random, time,sys,websocket,os
os.system("cls")
#servid= input("servid: ")
channid= int(input("channid: "))
counter = 0
proxys = []
WORDS = ["**BAHAHHA**", "**BAHAHHA**", "**BAHAHHA**"]
ID = ["884117157879877693"]
def connect(token):
global counter
header = { "Authorization": str(token).replace("\n", ""),
"Content-type": "application/json",
}
msg = ""
for x in ID:
msg += f"<@{x}> "
data = {"content": f"{msg} **SEND LES T0KENS EN MP STP <3**" } #f"{random.choice(WORDS)}"}
# NSL chat "https://discord.com/api/v9/channels/971495740268511244/messages"
for x in range(1000000):
r = requests.post(f"https://discord.com/api/v9/channels/{channid}/messages", headers=header, json=data)
if r.status_code == 200:
counter +=1
print(counter)
time.sleep(.3)
def changegame(token, game, type, status):
#print("Done " + token)
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/catcha80"
}
elif type == "Listening to":
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
f = open("tokens.txt", 'r')
for token in f:
#print("CONNECTING TO TOKEN: ", token)
type = "Playing"
game = "discord.gg/catcha"
status = ['online', 'dnd', 'idle','random']
status = status[3]
threading.Thread(target=connect, args=(token,)).start()
threading.Thread(target=lambda : changegame(token.replace("\n",""), game, type, status)).start()