Пример #1
0
 def get_top(self, limit=10, cursor=None):
     if limit > 100:
         raise TwitchAttributeException(
             'Maximum number of objects returned in one request is 100')
     params = {'limit': limit, 'cursor': cursor}
     response = self._request_get('communities/top', params=params)
     return [Community.construct_from(x) for x in response['communities']]
Пример #2
0
 def get_top(self, limit=10, cursor=None):
     if limit > 100:
         raise TwitchAttributeException(
             "Maximum number of objects returned in one request is 100"
         )
     params = {"limit": limit, "cursor": cursor}
     response = self._request_get("communities/top", params=params)
     return [Community.construct_from(x) for x in response["communities"]]
Пример #3
0
 def get_community(self, channel_id):
     response = self._request_get('channels/{}/community'.format(channel_id))
     return Community.construct_from(response)
Пример #4
0
 def get_by_name(self, community_name):
     params = {'name': community_name}
     response = self._request_get('communities', params=params)
     return Community.construct_from(response)
Пример #5
0
 def get_by_id(self, community_id):
     response = self._request_get('communities/{}'.format(community_id))
     return Community.construct_from(response)
Пример #6
0
 def get_community(self, channel_id):
     response = self._request_get('channels/%s/community' % channel_id)
     return Community.construct_from(response)