Skip to content

Commit

Permalink
Fix followers
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaserlang committed Oct 4, 2023
1 parent 705713a commit d2873c2
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tbot/twitch_bot/functions/title_game_views_followers.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import logging
from tbot.twitch_bot.var_filler import fills_vars, Send_error
from tbot import utils

@fills_vars('title', 'game')
async def title_game_views_followers(bot, channel_id, **kwargs):
async def get_title_game(bot, channel_id, **kwargs):
data = await utils.twitch_request(bot.ahttp,
f'https://api.twitch.tv/helix/channels?broadcaster_id={channel_id}',
)
Expand All @@ -15,9 +14,13 @@ async def title_game_views_followers(bot, channel_id, **kwargs):
}

@fills_vars('followers')
async def title_game_views_followers(bot, channel_id, **kwargs):
data = await utils.twitch_request(bot.ahttp,
f'https://api.twitch.tv/helix/users/follows?to_id={channel_id}&first=1',
async def get_followers(bot, channel_id, **kwargs):
data = await utils.twitch_channel_token_request(bot.ahttp, channel_id,
'https://api.twitch.tv/helix/channels/followers',
params={
'first': 1,
'broadcaster_id': channel_id,
}
)
if not data['data']:
raise Send_error('No data')
Expand Down

0 comments on commit d2873c2

Please sign in to comment.