-
Notifications
You must be signed in to change notification settings - Fork 0
/
economy-cheat.py
73 lines (56 loc) · 2.09 KB
/
economy-cheat.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
import os
import yaml
import requests
import time
import random
class EconomyCheat():
@property
def get_config(self):
with open("./config/config.yaml") as f:
config = yaml.load(f, Loader=yaml.FullLoader)
return config
def __init__(self):
self.config = self.get_config
self.token = self.config["TOKEN"]
self.channels = self.config["CHANNELS"]
self.headers = {
"Authorization": self.token,
"Content-Type": "application/json"
}
if not self.token:
print("Error: Invalid token")
os.system("pause")
exit()
if not self.channels:
print("Error: No channels specified")
os.system("pause")
exit()
@property
def get_cooldown(self) -> int:
cooldown = self.config["COOLDOWN"]
if self.config["RANDOMIZED-COOLDOWN"]:
return random.randint(cooldown, cooldown + self.config["RANDOMIZATION-RANGE"])
else:
return cooldown
def execute(self):
while True:
for channel in self.channels:
print(f"\nStarting sequence in channel {channel}")
for command in self.channels[channel]["SEQUENCE"]:
request = requests.post(
url= f"https://discordapp.com/api/v6/channels/{channel}/messages",
headers= self.headers,
json= {"content": self.channels[channel]["PREFIX"] + command}
)
if request.status_code != 200:
print(f"Error: {request.status_code}")
print(request.json())
break
print(f"Command: {command} sended!".rjust(5))
time.sleep(self.channels[channel]["DELAY-PER-COMMAND"])
time.sleep(self.get_cooldown)
def main():
cheat = EconomyCheat()
cheat.execute()
if __name__ == "__main__":
main()