def get_timed_out_users(self, community_id, 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/{}/timeouts'.format(community_id), params=params) return [User.construct_from(x) for x in response['timed_out_users']]
def get_timed_out_users(self, community_id, 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/{}/timeouts".format(community_id), params=params ) return [User.construct_from(x) for x in response["timed_out_users"]]
def get_editors(self, channel_id): response = self._request_get('channels/{}/editors'.format(channel_id)) return [User.construct_from(x) for x in response['users']]
def translate_usernames_to_ids(self, usernames): if isinstance(usernames, list): usernames = ','.join(usernames) response = self._request_get('users?login={}'.format(usernames)) return [User.construct_from(x) for x in response['users']]
def get(self): response = self._request_get('user') return User.construct_from(response)
def get_by_id(self, user_id): response = self._request_get('users/{}'.format(user_id)) return User.construct_from(response)
def get_moderators(self, community_id): response = self._request_get( 'communities/{}/moderators'.format(community_id)) return [User.construct_from(x) for x in response['moderators']]
def get_by_id(self, user_id): response = self._request_get('users/%s' % user_id) return User.construct_from(response)