idea
This commit is contained in:
parent
da06145f25
commit
4f55c84ba8
@ -16,7 +16,6 @@ import discord.channel
|
|||||||
|
|
||||||
class Discord_Module(discord.Client):
|
class Discord_Module(discord.Client):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
|
||||||
self.dbCredential: credentials.DB_Credential
|
self.dbCredential: credentials.DB_Credential
|
||||||
self.discordCredential: credentials.Discord_Credential
|
self.discordCredential: credentials.Discord_Credential
|
||||||
|
|
||||||
|
|||||||
59
main.py
59
main.py
@ -11,8 +11,10 @@ import utilities_script as utility
|
|||||||
|
|
||||||
import credentials
|
import credentials
|
||||||
|
|
||||||
twitch_chat: twitch_script.Twitch_Module
|
import threading
|
||||||
credentials_manager: credentials.Credentials_Module
|
|
||||||
|
#twitch_chat: twitch_script.Twitch_Module
|
||||||
|
#credentials_manager: credentials.Credentials_Module
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
global twitch_chat
|
global twitch_chat
|
||||||
@ -32,14 +34,61 @@ def main():
|
|||||||
|
|
||||||
twitch_chat.join_channel(None, "thecuriousnerd")
|
twitch_chat.join_channel(None, "thecuriousnerd")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#discord_connection.main()
|
||||||
|
#Doesn't do stuff past this point
|
||||||
|
|
||||||
|
#twitch_chat.send_message("activated")
|
||||||
|
|
||||||
|
#discord_connection.main()
|
||||||
|
|
||||||
|
def new_main(inputArg):
|
||||||
|
args = utility.get_args(inputArg)
|
||||||
|
|
||||||
|
|
||||||
|
def twitch_module_init(dbCert, twitchCert):
|
||||||
|
|
||||||
|
twitch_chat = twitch_script.Twitch_Module()
|
||||||
|
twitch_chat.db_manager.setup_engine(dbCert)
|
||||||
|
twitch_chat.twitchCredential = twitchCert
|
||||||
|
|
||||||
|
twitch_chat.join_channel(None, "thecuriousnerd")
|
||||||
|
|
||||||
|
|
||||||
|
def discord_module_init(dbCert, discordCert):
|
||||||
|
|
||||||
discord_connection = discord_script.Discord_Module()
|
discord_connection = discord_script.Discord_Module()
|
||||||
discord_connection.dbCredential = dbCert
|
discord_connection.dbCredential = dbCert
|
||||||
discord_connection.discordCredential = discordCert
|
discord_connection.discordCredential = discordCert
|
||||||
|
|
||||||
discord_connection.main()
|
discord_connection.main()
|
||||||
#Doesn't do stuff past this point
|
|
||||||
|
|
||||||
twitch_chat.send_message("activated")
|
|
||||||
|
|
||||||
|
def thread_main():
|
||||||
|
global twitch_chat
|
||||||
|
global credentials_manager
|
||||||
|
credentials_manager = credentials.Credentials_Module()
|
||||||
|
credentials_manager.load_credentials()
|
||||||
|
dbCert: credentials.DB_Credential = credentials_manager.find_Credential(credentials.DB_Credential, "praxis_bot")
|
||||||
|
twitchCert: credentials.Twitch_Credential = credentials_manager.find_Twitch_Credential("praxis_bot")
|
||||||
|
discordCert: credentials.Discord_Credential = credentials_manager.find_Discord_Credential("praxis_bot")
|
||||||
|
|
||||||
|
threads = []
|
||||||
|
|
||||||
|
twitch = threading.Thread(target=twitch_module_init, args=(dbCert, twitchCert))
|
||||||
|
threads.append(twitch)
|
||||||
|
twitch.start()
|
||||||
|
|
||||||
|
discord = threading.Thread(target=discord_module_init, args=(dbCert, discordCert))
|
||||||
|
threads.append(discord)
|
||||||
|
discord.start()
|
||||||
|
|
||||||
|
for t in threads:
|
||||||
|
t.join()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
thread_main()
|
||||||
|
|||||||
@ -1,3 +1,6 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
clearScreen = lambda: os.system('cls' if os.name == 'nt' else 'clear')
|
clearScreen = lambda: os.system('cls' if os.name == 'nt' else 'clear')
|
||||||
|
|
||||||
|
def get_args(text: str) -> list:
|
||||||
|
return text.split(" ")
|
||||||
Loading…
Reference in New Issue
Block a user