예제 #1
0
 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']]
예제 #2
0
 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"]]
예제 #3
0
 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']]
예제 #4
0
    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']]
예제 #5
0
 def get(self):
     response = self._request_get('user')
     return User.construct_from(response)
예제 #6
0
 def get_by_id(self, user_id):
     response = self._request_get('users/{}'.format(user_id))
     return User.construct_from(response)
예제 #7
0
 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']]
예제 #8
0
 def get_by_id(self, user_id):
     response = self._request_get('users/%s' % user_id)
     return User.construct_from(response)