Added the DB Credential Template
This commit is contained in:
parent
97166feaf0
commit
7d0520b0b0
12
README.md
12
README.md
@ -1,15 +1,19 @@
|
|||||||
A chatbot to help with live stream production/effects.
|
A chatbot to help with live stream production/effects.
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
# Credentials Setup:
|
# 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`
|
Username = `TwitchUsername`
|
||||||
|
|
||||||
Helix ID = `https://dev.twitch.tv/console/apps`
|
Helix Client ID = `https://dev.twitch.tv/console/apps`
|
||||||
|
|
||||||
Oauth = `https://twitchapps.com/tmi/`
|
Oauth = `https://twitchapps.com/tmi/`
|
||||||
|
|
||||||
V5 Client ID = `https://twitchtokengenerator.com/`
|
V5 Client ID = `https://twitchtokengenerator.com/`
|
||||||
|
|
||||||
## For Database Credentials in db_cred.py
|
## For Database Credentials
|
||||||
engine = `"mysql+mysqlconnector://root:password@localhost:3306/DatabaseName"`
|
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",
|
"username": "something",
|
||||||
"helix": "secret",
|
"helix": "Helix Client ID",
|
||||||
"oauth": "token",
|
"oauth": "token",
|
||||||
"v5_client": "I have no idea here"
|
"v5_client": "Client ID"
|
||||||
}
|
}
|
||||||
@ -97,7 +97,11 @@ class Credentials_Module():
|
|||||||
return tobj
|
return tobj
|
||||||
|
|
||||||
def load_DB_Credential(self, fileName: str):
|
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
|
credentialLoadingFunctions = { # this is a mapping of the Credential enum to function pointers
|
||||||
Credential.Twitch_Credential: load_Twitch_Credential,
|
Credential.Twitch_Credential: load_Twitch_Credential,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user