diff --git a/credential_templates/credential_template_discord.json b/credential_templates/credential_template_discord.json index 68038f9..51f9dc0 100644 --- a/credential_templates/credential_template_discord.json +++ b/credential_templates/credential_template_discord.json @@ -1,6 +1,4 @@ { - "username": "discord", - "helix": "secret discord", - "oauth": "token discord", - "v5_client": "I have no idea here" + "username": "AnythingYouWant", + "token": "" } \ No newline at end of file diff --git a/credentials.py b/credentials.py index 1e5c551..6bbd105 100644 --- a/credentials.py +++ b/credentials.py @@ -24,13 +24,11 @@ class Twitch_Credential(): class Discord_Credential(): # Discord Credentials explanations here. - def __init__(self, username, helix, oauth, v5_client): + def __init__(self, nickname, token): # super().__init__() # all of this is completely made up, i just wanted to make sure your file name switch worked right - self.username = username - self.helix = helix - self.oauth = oauth - self.v5_client = v5_client + self.nickname = nickname + self.token = token class DB_Credential(): # engine = "mysql+mysqlconnector://root:password@localhost:3306/DatabaseName" @@ -149,8 +147,8 @@ class Credentials_Module(): foundSomething = False tempCert: Discord_Credential for cert in self.Discord_Credentials_List: - if cert.username == searchParam: - print("Discord Credential Found: {" + cert.username + "}") + if cert.nickname == searchParam: + print("Discord Credential Found: {" + cert.nickname + "}") tempCert = cert foundSomething = True if foundSomething: diff --git a/db.py b/db.py index cb1aef3..2888f72 100644 --- a/db.py +++ b/db.py @@ -13,7 +13,7 @@ class db_module(): self.currentWorkingDB: str self.engine = None - def setup_engine(self, credential: credentials.DB_Credential): + def setup_engine(self, credential: credentials.DB_Credential = None): createEngine = True if credential is None: if self.dbCredential is None: @@ -69,5 +69,9 @@ class db_module(): if __name__ == "__main__": - db_connection = db_module() - db_connection.setup_engine() + testModule = db_module() + + credentials_manager = credentials.Credentials_Module() + credentials_manager.load_credentials() + testModule.dbCredential = credentials_manager.find_DB_Credential("praxis_bot") + testModule.setup_engine() diff --git a/discord_script.py b/discord_script.py new file mode 100644 index 0000000..2dc66b9 --- /dev/null +++ b/discord_script.py @@ -0,0 +1,32 @@ +import random +import re + +import config as config +import db +import tts + +import credentials + +import discord + +class Discord_Module(discord.Client): + def __init__(self): + super().__init__() + self.dbCredential: credentials.DB_Credential + self.discordCredential: credentials.Discord_Credential + + self.tts_enabled: bool = False + + def main(self): + self.run(self.discordCredential.token) + + + +if __name__ == "__main__": + testModule = Discord_Module() + + credentials_manager = credentials.Credentials_Module() + credentials_manager.load_credentials() + testModule.dbCredential = credentials_manager.find_DB_Credential("praxis_bot") + testModule.discordCredential = credentials_manager.find_Discord_Credential("praxis_bot") + testModule.main() diff --git a/twitch_script.py b/twitch_script.py index fa5f011..3c55d2e 100644 --- a/twitch_script.py +++ b/twitch_script.py @@ -197,5 +197,10 @@ def main_chat_commands_check(channel, sender, text): if __name__ == "__main__": - testChat = Twitch_Module() - testChat.join_channel("thecuriousnerd") + testModule = Twitch_Module() + + credentials_manager = credentials.Credentials_Module() + credentials_manager.load_credentials() + testModule.twitchCredential = credentials_manager.find_Twitch_Credential("praxis_bot") + testModule.dbCredential = credentials_manager.find_DB_Credential("praxis_bot") + testModule.join_channel(None ,"thecuriousnerd") \ No newline at end of file