-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
37 lines (31 loc) · 1.02 KB
/
main.py
File metadata and controls
37 lines (31 loc) · 1.02 KB
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
from pynput import keyboard
from bot import Bot as Bot_Std
from bot_chat import Bot as Bot_Chat
import sys
import argparse
# Initialize parser
parser = argparse.ArgumentParser()
# Adding optional argument
parser.add_argument("-c", "--chat", required=True)
parser.add_argument("-H", "--headless")
parser.add_argument("-C", "--chatmode")
# Read arguments from command line
args = parser.parse_args()
if len(sys.argv) <= 1:
print('Not enough arhuments')
with open('usage.txt', 'r') as f:
print(f.read())
sys.exit(1)
else:
headless = True if args.headless == 'True' or args.headless == 'true' else False
if args.chatmode:
if args.chatmode.lower() == "male":
my_bot = Bot_Chat(args.chat, HEADLESS=headless, BOT="male")
else:
my_bot = Bot_Chat(args.chat, HEADLESS=headless, BOT="female")
else:
my_bot = Bot_Std(args.chat, HEADLESS=headless)
# Keyboard event listener
listener = keyboard.Listener(on_press=my_bot.on_press)
listener.start()
my_bot.init_bot()