Compare commits
2 Commits
97166feaf0
...
d773d8b8da
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d773d8b8da | ||
|
|
7d0520b0b0 |
12
README.md
12
README.md
@ -1,15 +1,19 @@
|
||||
A chatbot to help with live stream production/effects.
|
||||
|
||||
___
|
||||
|
||||
# Credentials Setup:
|
||||
|
||||
## For Twitch Credentials in twitch_cred.py
|
||||
Create a json based on the templates and put them into the credentials folder.
|
||||
|
||||
## For Twitch Credentials
|
||||
Username = `TwitchUsername`
|
||||
|
||||
Helix ID = `https://dev.twitch.tv/console/apps`
|
||||
Helix Client ID = `https://dev.twitch.tv/console/apps`
|
||||
|
||||
Oauth = `https://twitchapps.com/tmi/`
|
||||
|
||||
V5 Client ID = `https://twitchtokengenerator.com/`
|
||||
|
||||
## For Database Credentials in db_cred.py
|
||||
engine = `"mysql+mysqlconnector://root:password@localhost:3306/DatabaseName"`
|
||||
## For Database Credentials
|
||||
Engine = `"mysql+mysqlconnector://root:password@localhost:3306/DatabaseName"`
|
||||
|
||||
3
credential_templates/credential_template_db.json
Normal file
3
credential_templates/credential_template_db.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"engine": "mysql+mysqlconnector://root:password@localhost:3306/DatabaseName"
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"username": "something",
|
||||
"helix": "secret",
|
||||
"helix": "Helix Client ID",
|
||||
"oauth": "token",
|
||||
"v5_client": "I have no idea here"
|
||||
"v5_client": "Client ID"
|
||||
}
|
||||
@ -61,12 +61,18 @@ class Credentials_Module():
|
||||
if file.lower().find("twitch") != -1:
|
||||
credential_loading_function = self.credentialLoadingFunctions.get(Credential.Twitch_Credential)
|
||||
output = credential_loading_function(self, file)
|
||||
if output is not None:
|
||||
self.Twitch_Credentials_List.append(output)
|
||||
if file.lower().find("discord") != -1:
|
||||
credential_loading_function = self.credentialLoadingFunctions.get(Credential.Discord_Credential)
|
||||
output = credential_loading_function(self, file)
|
||||
if output is not None:
|
||||
self.Discord_Credentials_List.append(output)
|
||||
if file.lower().find("db") != -1:
|
||||
credential_loading_function = self.credentialLoadingFunctions.get(Credential.DB_Credential)
|
||||
output = credential_loading_function(self, file)
|
||||
if output is not None:
|
||||
self.DB_Credentials_List.append(output)
|
||||
|
||||
def list_credential_files(self):
|
||||
credentialPath = self.get_credentials_dir()
|
||||
@ -97,7 +103,11 @@ class Credentials_Module():
|
||||
return tobj
|
||||
|
||||
def load_DB_Credential(self, fileName: str):
|
||||
return None
|
||||
file_path = os.path.join(self.get_credentials_dir(), fileName)
|
||||
f = open(file_path)
|
||||
raw_json = json.loads(f.read())
|
||||
tobj = DB_Credential(**raw_json)
|
||||
return tobj
|
||||
|
||||
credentialLoadingFunctions = { # this is a mapping of the Credential enum to function pointers
|
||||
Credential.Twitch_Credential: load_Twitch_Credential,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user