Compare commits
No commits in common. "1abfc12fa063d75d579e81e6989374e632af8b64" and "cef938b10d4c29e9435dbe4ccbee92c4c8c15f95" have entirely different histories.
1abfc12fa0
...
cef938b10d
@ -10,7 +10,7 @@ Create a json based on the templates and put them into the `/credentials/` folde
|
|||||||
Refer to the `/credential_templates/` folder for examples.
|
Refer to the `/credential_templates/` folder for examples.
|
||||||
|
|
||||||
### For Twitch Credentials
|
### For Twitch Credentials
|
||||||
Username = `TwitchUsername` *(Must match ***credentialsNickname*** in config)*
|
Username = `TwitchUsername`
|
||||||
|
|
||||||
Helix Client ID = `https://dev.twitch.tv/console/apps`
|
Helix Client ID = `https://dev.twitch.tv/console/apps`
|
||||||
|
|
||||||
@ -19,12 +19,12 @@ Oauth = `https://twitchapps.com/tmi/`
|
|||||||
V5 Client ID = `https://twitchtokengenerator.com/`
|
V5 Client ID = `https://twitchtokengenerator.com/`
|
||||||
|
|
||||||
### For Database Credentials
|
### For Database Credentials
|
||||||
Nickname = `Anything You Want` *(Must match ***credentialsNickname*** in config)*
|
Nickname = `Anything You Want`
|
||||||
|
|
||||||
Engine = `"mysql+mysqlconnector://root:password@localhost:3306/DatabaseName"`
|
Engine = `"mysql+mysqlconnector://root:password@localhost:3306/DatabaseName"`
|
||||||
|
|
||||||
### For Discord Credentials
|
### For Discord Credentials
|
||||||
Nickname = `Anything You Want` *(Must match ***credentialsNickname*** in config)*
|
Nickname = `Anything You Want`
|
||||||
|
|
||||||
Token = `https://discord.com/developers/`
|
Token = `https://discord.com/developers/`
|
||||||
|
|
||||||
|
|||||||
@ -1,14 +1,5 @@
|
|||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
|
||||||
credentialsNickname = "praxis_bot"
|
|
||||||
|
|
||||||
twitch_module: bool = True
|
|
||||||
discord_module: bool = True
|
|
||||||
|
|
||||||
autojoinTwitchChannels = ("thecuriousnerd")
|
|
||||||
|
|
||||||
selected_discordTTSChannels = ("431129571308339210")
|
|
||||||
|
|
||||||
|
|
||||||
class Speaker(Enum):
|
class Speaker(Enum):
|
||||||
GOOGLE_TEXT_TO_SPEECH = 1
|
GOOGLE_TEXT_TO_SPEECH = 1
|
||||||
|
|||||||
18
main.py
18
main.py
@ -8,7 +8,6 @@ import twitch_script
|
|||||||
import discord_script
|
import discord_script
|
||||||
|
|
||||||
import utilities_script as utility
|
import utilities_script as utility
|
||||||
import config as config
|
|
||||||
|
|
||||||
import credentials
|
import credentials
|
||||||
|
|
||||||
@ -26,16 +25,14 @@ def twitch_module_init(dbCert, twitchCert):
|
|||||||
twitch_chat.db_manager.setup_engine(dbCert)
|
twitch_chat.db_manager.setup_engine(dbCert)
|
||||||
twitch_chat.twitchCredential = twitchCert
|
twitch_chat.twitchCredential = twitchCert
|
||||||
|
|
||||||
for twitchChannel in config.autojoinTwitchChannels.split():
|
twitch_chat.join_channel(None, "thecuriousnerd")
|
||||||
twitch_chat.join_channel(None, twitchChannel)
|
|
||||||
|
|
||||||
|
|
||||||
def discord_module_init(dbCert, discordCert):
|
def discord_module_init(dbCert, discordCert):
|
||||||
discord_connection.dbCredential = dbCert
|
discord_connection.dbCredential = dbCert
|
||||||
discord_connection.discordCredential = discordCert
|
discord_connection.discordCredential = discordCert
|
||||||
|
|
||||||
for ttsChannel in config.selected_discordTTSChannels.split():
|
discord_connection.selected_ttsChannels.append(431129571308339210)
|
||||||
discord_connection.selected_ttsChannels.append(int(ttsChannel))
|
|
||||||
|
|
||||||
discord_connection.main()
|
discord_connection.main()
|
||||||
|
|
||||||
@ -51,17 +48,16 @@ def thread_main():
|
|||||||
credentials_manager = credentials.Credentials_Module()
|
credentials_manager = credentials.Credentials_Module()
|
||||||
|
|
||||||
credentials_manager.load_credentials()
|
credentials_manager.load_credentials()
|
||||||
dbCert: credentials.DB_Credential = credentials_manager.find_Credential(credentials.DB_Credential, config.credentialsNickname)
|
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 = []
|
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))
|
twitch = threading.Thread(target=twitch_module_init, args=(dbCert, twitchCert))
|
||||||
threads.append(twitch)
|
threads.append(twitch)
|
||||||
twitch.start()
|
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))
|
discord = threading.Thread(target=discord_module_init, args=(dbCert, discordCert))
|
||||||
threads.append(discord)
|
threads.append(discord)
|
||||||
discord.start()
|
discord.start()
|
||||||
@ -71,7 +67,7 @@ def thread_main():
|
|||||||
t.join()
|
t.join()
|
||||||
|
|
||||||
print("---Point of no return---")
|
print("---Point of no return---")
|
||||||
input()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user