Fix follower subscriber auth.
This commit is contained in:
@@ -42,6 +42,7 @@ class TrackerComponent(cmds.Component):
|
||||
|
||||
# Build subscription payloads based on available scopes
|
||||
subs = []
|
||||
usersubs = []
|
||||
subcls = []
|
||||
if Scopes.channel_read_redemptions in scopes or Scopes.channel_manage_redemptions in scopes:
|
||||
subcls.append(eventsub.ChannelPointsRedeemAddSubscription)
|
||||
@@ -82,7 +83,7 @@ class TrackerComponent(cmds.Component):
|
||||
# )
|
||||
# )
|
||||
if Scopes.moderator_read_followers in scopes:
|
||||
subs.append(
|
||||
usersubs.append(
|
||||
eventsub.ChannelFollowSubscription(
|
||||
broadcaster_user_id=channel.userid,
|
||||
moderator_user_id=channel.userid,
|
||||
@@ -101,6 +102,13 @@ class TrackerComponent(cmds.Component):
|
||||
else:
|
||||
resp = await self.bot.subscribe_websocket(sub)
|
||||
responses.append(resp)
|
||||
for sub in usersubs:
|
||||
if self.bot.using_webhooks:
|
||||
resp = await self.bot.subscribe_webhook(sub)
|
||||
else:
|
||||
resp = await self.bot.subscribe_websocket(sub, token_for=channel.userid)
|
||||
responses.append(resp)
|
||||
|
||||
|
||||
logger.info("Finished tracker subscription to %s: %s", channel.userid, ', '.join(map(str, responses)))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user