-
Notifications
You must be signed in to change notification settings - Fork 88
/
main.py
44 lines (30 loc) · 1001 Bytes
/
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
import os
from src.enums import Mode
os.environ["BASE_DIR_PATH"] = os.getcwd()
mode = Mode.STREAMER # Recommended Mode
if __name__ == "__main__":
if mode == Mode.VLC_CLOUD:
from src.twitchbot import Bot
bot = Bot()
bot.run()
elif mode == Mode.SPEAKER:
from src.twitchbot import Bot
bot = Bot(speaker_bot=True)
bot.run()
elif mode == Mode.STREAMER:
import threading
from src.logger import Logger
from src.speaker_bot_based import Bot as SpeakerBot
from src.queue_consumer import QueueConsumer
logger = Logger(
console_log=True,
file_logging=True,
file_URI="logs/log.txt",
override=True,
)
consumer = QueueConsumer(logger=logger, verbose=True, answer_rate=20)
bot = SpeakerBot(consumer, logger)
process = threading.Thread(target=consumer.run)
process.start()
bot.run()
process.join()