# I moved all the requirements into requirements.txt. # you can install everything with pip install -r requirements.txt while you're in the directory import sys import time import twitch_script import discord_script import test_module import user_module import utilities_script as utility import config as config import credentials import threading twitchModule_: twitch_script.Twitch_Module discordModule_: discord_script.Discord_Module testModule_: test_module.Test_Module userModule_: user_module.User_Module credentials_manager: credentials.Credentials_Module def main(inputArg): args = utility.get_args(inputArg) def twitch_module_init(dbCert, twitchCert): print("-init [TWITCH Module]") twitchModule_.db_manager.setup_engine(dbCert) twitchModule_.twitchCredential = twitchCert twitchModule_.tts_enabled = config.autoEnabled_TwitchChannelsTTS twitchModule_.whitelisted_users = config.whitelisted_TwitchPowerUsers print("[TWITCH Module]>", "Loading Channels...") for twitchChannel in config.autoJoin_TwitchChannels: print("joining twitch channel:", twitchChannel) twitchModule_.join_channel(None, twitchChannel) def discord_module_init(dbCert, discordCert): print("-init [DISCORD Module]") discordModule_.dbCredential = dbCert discordModule_.discordCredential = discordCert discordModule_.tts_enabled = config.autoEnabled_DiscordChannelsTTS for ttsChannel in config.selected_DiscordTTSChannels: discordModule_.selected_ttsChannels.append(int(ttsChannel)) discordModule_.main() def test_module_init(dbCert, Empty): print("-init [TEST Module]") #testModule_.dbCredential = dbCert testModule_.main() def user_module_init(dbCert, Empty): print("-init [USER Module]") userModule_.dbCredential = dbCert userModule_.main() def thread_main(): if utility.isRunningInDocker() == True: print("<[DOCKER Detected]>") if not config.skip_splashScreen: utility.splashScreen() global credentials_manager global twitchModule_ global discordModule_ global testModule_ global userModule_ credentials_manager = credentials.Credentials_Module() twitchModule_ = twitch_script.Twitch_Module() discordModule_ = discord_script.Discord_Module() testModule_ = test_module.Test_Module() userModule_ = user_module.User_Module() credentials_manager.load_credentials() dbCert: credentials.DB_Credential = credentials_manager.find_Credential(credentials.DB_Credential, config.credentialsNickname) threads = [] if config.twitch_module == True: twitchCert: credentials.Twitch_Credential = credentials_manager.find_Twitch_Credential(config.credentialsNickname) thread_ = threading.Thread(target=twitch_module_init, args=(dbCert, twitchCert)) thread_.daemon = True threads.append(thread_) thread_.start() if config.discord_module == True: discordCert: credentials.Discord_Credential = credentials_manager.find_Discord_Credential(config.credentialsNickname) thread_ = threading.Thread(target=discord_module_init, args=(dbCert, discordCert)) thread_.daemon = True threads.append(thread_) thread_.start() if config.test_module == True: thread_ = threading.Thread(target=test_module_init, args=(dbCert, None)) thread_.daemon = True threads.append(thread_) thread_.start() if config.user_module == True: if utility.isRunningInDocker() == False: config.user_module = False thread_ = threading.Thread(target=user_module_init, args=(dbCert, None)) thread_.daemon = True threads.append(thread_) thread_.start() print("---Post Thread Creation Test---\n") for t in threads: t.join() print("---Point of no return---") if utility.isRunningInDocker() == False: input() if __name__ == "__main__": thread_main()