예제 #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)