Browse Source

Change "follow/unfollow channel" to GQL queries (#592)

Change follow/unfollow to GQL queries, due to discontinued official API endpoints (https://discuss.dev.twitch.tv/t/deprecation-of-create-and-delete-follows-api-endpoints)
pull/594/head
apo86 2 months ago
committed by GitHub
parent
commit
3d1d7cb504
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      resources/lib/twitch_addon/addon/api.py

6
resources/lib/twitch_addon/addon/api.py

@ -238,14 +238,12 @@ class Twitch:
@api_error_handler
def follow(self, channel_id):
user_id = self.get_user_id()
results = self.api.users.follow_channel(user_id=user_id, channel_id=channel_id)
results = self.api.users.follow_channel(channel_id=channel_id, headers=self.get_private_credential_headers())
return self.error_check(results)
@api_error_handler
def unfollow(self, channel_id):
user_id = self.get_user_id()
results = self.api.users.unfollow_channel(user_id=user_id, channel_id=channel_id)
results = self.api.users.unfollow_channel(channel_id=channel_id, headers=self.get_private_credential_headers())
return self.error_check(results)
@api_error_handler

Loading…
Cancel
Save