fix uptime command. resolves #19
This commit is contained in:
parent
411c2c9fd2
commit
cf456e816f
5
bot.py
5
bot.py
|
|
@ -349,7 +349,10 @@ def cmd_videoidea(match: Match[str]) -> Response:
|
||||||
class UptimeResponse(Response):
|
class UptimeResponse(Response):
|
||||||
async def __call__(self, config: Config) -> Optional[str]:
|
async def __call__(self, config: Config) -> Optional[str]:
|
||||||
url = f'https://api.twitch.tv/helix/streams?user_login={config.channel}' # noqa: E501
|
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 aiohttp.ClientSession() as session:
|
||||||
async with session.get(url, headers=headers) as response:
|
async with session.get(url, headers=headers) as response:
|
||||||
text = await response.text()
|
text = await response.text()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue