rearange files and updateing files
This commit is contained in:
1 parent
20acb4bc9f
commit
2de2c461e2
28 files changed
+285
-188
No files matched your search
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env python3
|
||||
import json
|
||||
|
||||
from twitchAPI.twitch import Twitch
|
||||
from twitchAPI.helper import first
|
||||
|
||||
from package.config import CHANNEL_NAME as CHANNEL_NAME
|
||||
|
||||
# 1. Fill in your credentials from the Twitch Developer Console
|
||||
SECRETS = None
|
||||
TWITCH = None
|
||||
USER = None
|
||||
|
||||
async def get_twitch():
|
||||
global SECRETS, TWITCH, USER
|
||||
if SECRETS is None:
|
||||
with open('twitch_secrets.json', 'r') as f:
|
||||
SECRETS = json.load(f)
|
||||
if TWITCH is None:
|
||||
TWITCH = await Twitch(SECRETS['client_id'], SECRETS['client_secret'])
|
||||
if USER is None:
|
||||
USER = await first(TWITCH.get_users(logins=[CHANNEL_NAME]))
|
||||
if not USER:
|
||||
print("User not found.")
|
||||
Reference in new issue
Block a user