-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
88 lines (70 loc) · 3.29 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
import os, time, json
from sys import stdout
def purple():
PURPLE = "\033[1;35m"
stdout.write(PURPLE)
def white():
WHITE = "\033[1;37m"
stdout.write(WHITE)
with open("config/config.json") as config_file:
config = json.load(config_file)
with open('lang/' + config['lang'] + '_lang.json') as lang_file:
lang = json.load(lang_file)
banner = """
░█████╗░██╗░░░██╗████████╗░█████╗░ ██████╗░░█████╗░███╗░░██╗
██╔══██╗██║░░░██║╚══██╔══╝██╔══██╗ ██╔══██╗██╔══██╗████╗░██║
███████║██║░░░██║░░░██║░░░██║░░██║ ██████╦╝███████║██╔██╗██║
██╔══██║██║░░░██║░░░██║░░░██║░░██║ ██╔══██╗██╔══██║██║╚████║ (by IOxee)
██║░░██║╚██████╔╝░░░██║░░░╚█████╔╝ ██████╦╝██║░░██║██║░╚███║
╚═╝░░╚═╝░╚═════╝░░░░╚═╝░░░░╚════╝░ ╚═════╝░╚═╝░░╚═╝╚═╝░░╚══╝
Moderation Tool for Twitch
"""
def show_menu():
purple()
print(banner)
white()
for option in lang['menu_messages']:
print(option['numberation'] + ". " + option['option'])
time.sleep(0.1)
while True:
try:
os.system('cls' if os.name == 'nt' else 'clear')
show_menu()
choice = input(lang['menu_select'])
if choice == "1":
print(lang['extracting_bots'])
os.system('python extract.py')
time.sleep(3)
print(lang['bots_extracted'].format(sum(1 for line in open("content/output_file"))))
proceed = input(lang['do_you_wish_to_continue'])
if proceed == "Y" or proceed == "y":
print(lang['start_with_bans'])
os.system('python ban.py')
else:
print(lang['exiting'])
time.sleep(2)
elif choice == "2":
print(lang['extracting_bots'])
os.system('python extract.py')
time.sleep(3)
print(lang['bots_extracted'].format(sum(1 for line in open("content/output_file"))))
time.sleep(2)
print(lang['exiting'])
time.sleep(2)
elif choice == "3":
print(lang['start_with_bans'])
os.system('python ban.py')
time.sleep(2)
print(lang['exiting'])
elif choice == "4":
print(lang['program_exiting'])
time.sleep(2)
os.system('cls' if os.name == 'nt' else 'clear')
break
else:
print(lang['invalid_input'])
except KeyboardInterrupt:
print(lang['program_exiting'])
time.sleep(2)
os.system('cls' if os.name == 'nt' else 'clear')
break