-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.py
89 lines (75 loc) · 2.76 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
import yaml
import threading
import selenium
import time, random
import sys, datetime
from colorama import Fore, Style
import webbrowser
webbrowser.open("https://guns.lol/hooked")
sys.dont_write_bytecode = True
from source.headers import Headers
from source.client import CreateClient
config_yaml = yaml.safe_load(open("config.yaml", "r"))
token_json = open('input/tokens.txt').read().split("\n")
vouch_json = open(f"input/vouch.txt", encoding="utf-8").read().split("\n")
client = CreateClient()
token_index = vouch_index = total_count = 0
random.shuffle(vouch_json)
random.shuffle(token_json)
class Printer:
def __init__(self) -> None:
self.lock = threading.Lock()
def curr_time(self):
data = datetime.datetime.now().strftime("%H:%M:%S")
return data
def success(self, title: str, desc: str):
self.lock.acquire()
time = Printer.curr_time(self)
print(
f"""{Fore.LIGHTBLACK_EX}[{time}] [{total_count}] {Fore.LIGHTBLUE_EX}{title}{Fore.LIGHTWHITE_EX} : {Fore.LIGHTGREEN_EX}{desc}{Style.RESET_ALL}"""
)
self.lock.release()
def denied(self, title: str, desc: str):
self.lock.acquire()
time = Printer.curr_time(self)
print(
f"""{Fore.LIGHTBLACK_EX}[{time}] [{total_count}] {Fore.LIGHTYELLOW_EX}{title}{Fore.LIGHTWHITE_EX} : {Fore.LIGHTRED_EX}{desc}{Style.RESET_ALL}"""
)
self.lock.release()
print_obj = Printer()
while total_count < config_yaml['Number']:
format_str = random.choice(config_yaml['formats'])
vouch_json[vouch_index] = vouch_json[vouch_index].rstrip()
req = None
try:
req = client.post(
url="https://discord.com/api/v9/channels/{}/messages".format(config_yaml['ChannelId']),
headers=Headers.get_headers(client, token_json[token_index]),
json={
"content": "{} <@{}> {}".format(
format_str, random.choice(config_yaml['VouchOwner']), vouch_json[vouch_index])
}
)
except:
pass
if req and req.status_code == 200:
total_count += 1
print_obj.success(title='Vouch Sent', desc=vouch_json[vouch_index])
else:
if req and req.text:
print_obj.denied(title='Vouch Error', desc=req.json().get("message"))
else:
print_obj.denied(title='Vouch Error', desc="Request Not Sent")
vouch_index += 1
token_index += 1
if vouch_index >= len(vouch_json):
random.shuffle(vouch_json)
vouch_index = 0
if token_index >= len(token_json):
random.shuffle(token_json)
token_index = 0
rand_time = random.randint(
int(config_yaml['TimeLimit']['low']),
int(config_yaml['TimeLimit']['high'])
)
time.sleep(rand_time)