Updated the template for database credentials. Added the credentials module to the twitch script. Modified the main.py to join my channel if it detects a specific credential.
41 lines
1.2 KiB
Python
41 lines
1.2 KiB
Python
# I moved all the requirements into requirements.txt.
|
|
# you can install everything with pip install -r requirements.txt while you're in the directory
|
|
|
|
import sys
|
|
import time
|
|
|
|
import twitch_script_class
|
|
|
|
import utilities_script as utility
|
|
|
|
import credentials
|
|
|
|
twitch_chat: twitch_script_class.Twitch_Module
|
|
credentials_manager: credentials.Credentials_Module
|
|
|
|
def main():
|
|
global twitch_chat
|
|
global credentials_manager
|
|
print("Loading credentials...")
|
|
credentials_manager = credentials.Credentials_Module()
|
|
credentials_manager.load_credentials()
|
|
|
|
twitch_chat = twitch_script_class.Twitch_Module()
|
|
|
|
mainCert: credentials.Twitch_Credential
|
|
if credentials_manager.Twitch_Credentials_List is not None:
|
|
for cert in credentials_manager.Twitch_Credentials_List:
|
|
if cert.username == "praxis_bot":
|
|
print("Twitch Certificate Found: " + cert.username)
|
|
mainCert = cert
|
|
twitch_chat.twitchCredential = cert
|
|
twitch_chat.join_channel(None, "thecuriousnerd")
|
|
|
|
#print("Connecting to Channels...")
|
|
#twitch_chat.join_channel(cert, "thecuriousnerd")
|
|
# twitch_chat.send_message("activated")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|