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']]
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"]]
def get_community(self, channel_id): response = self._request_get('channels/{}/community'.format(channel_id)) return Community.construct_from(response)
def get_by_name(self, community_name): params = {'name': community_name} response = self._request_get('communities', params=params) return Community.construct_from(response)
def get_by_id(self, community_id): response = self._request_get('communities/{}'.format(community_id)) return Community.construct_from(response)
def get_community(self, channel_id): response = self._request_get('channels/%s/community' % channel_id) return Community.construct_from(response)