fix uptime command. resolves #19

This commit is contained in:
Anthony Sottile 2020-05-04 15:19:25 -07:00
parent 411c2c9fd2
commit cf456e816f
1 changed files with 4 additions and 1 deletions

5
bot.py
View File

@ -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()