Moved things to Config
This commit is contained in:
parent
cef938b10d
commit
4be0adf737
@ -1,5 +1,14 @@
|
||||
from enum import Enum
|
||||
|
||||
credentialsNickname = "praxis_bot"
|
||||
|
||||
twitch_module: bool = True
|
||||
discord_module: bool = True
|
||||
|
||||
autojoinTwitchChannels = ("thecuriousnerd")
|
||||
|
||||
selected_discordTTSChannels = (431129571308339210)
|
||||
|
||||
|
||||
class Speaker(Enum):
|
||||
GOOGLE_TEXT_TO_SPEECH = 1
|
||||
|
||||
17
main.py
17
main.py
@ -8,6 +8,7 @@ import twitch_script
|
||||
import discord_script
|
||||
|
||||
import utilities_script as utility
|
||||
import config as config
|
||||
|
||||
import credentials
|
||||
|
||||
@ -25,14 +26,17 @@ def twitch_module_init(dbCert, twitchCert):
|
||||
twitch_chat.db_manager.setup_engine(dbCert)
|
||||
twitch_chat.twitchCredential = twitchCert
|
||||
|
||||
twitch_chat.join_channel(None, "thecuriousnerd")
|
||||
for twitchChannel in config.autojoinTwitchChannels:
|
||||
twitch_chat.join_channel(None, twitchChannel)
|
||||
|
||||
|
||||
def discord_module_init(dbCert, discordCert):
|
||||
discord_connection.dbCredential = dbCert
|
||||
discord_connection.discordCredential = discordCert
|
||||
|
||||
discord_connection.selected_ttsChannels.append(431129571308339210)
|
||||
for ttsChannel in config.selected_discordTTSChannels:
|
||||
discord_connection.selected_ttsChannels.append(ttsChannel)
|
||||
|
||||
|
||||
discord_connection.main()
|
||||
|
||||
@ -48,16 +52,17 @@ def thread_main():
|
||||
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")
|
||||
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)
|
||||
twitch = threading.Thread(target=twitch_module_init, args=(dbCert, twitchCert))
|
||||
threads.append(twitch)
|
||||
twitch.start()
|
||||
|
||||
if config.discord_module == True:
|
||||
discordCert: credentials.Discord_Credential = credentials_manager.find_Discord_Credential(config.credentialsNickname)
|
||||
discord = threading.Thread(target=discord_module_init, args=(dbCert, discordCert))
|
||||
threads.append(discord)
|
||||
discord.start()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user