From cf456e816f34638068910d77a04b6fb530a46b83 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 4 May 2020 15:19:25 -0700 Subject: [PATCH] fix uptime command. resolves #19 --- bot.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bot.py b/bot.py index 851ac87..9105232 100644 --- a/bot.py +++ b/bot.py @@ -349,7 +349,10 @@ def cmd_videoidea(match: Match[str]) -> Response: class UptimeResponse(Response): async def __call__(self, config: Config) -> Optional[str]: url = f'https://api.twitch.tv/helix/streams?user_login={config.channel}' # noqa: E501 - headers = {'Client-ID': config.client_id} + headers = { + 'Authorization': f'Bearer {config.oauth_token.split(":")[1]}', + 'Client-ID': config.client_id, + } async with aiohttp.ClientSession() as session: async with session.get(url, headers=headers) as response: text = await response.text()