예제 #1
0
    def get_post_comments(self, channel_id, post_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,
        }
        url = 'feed/{}/posts/{}/comments'.format(channel_id, post_id)
        response = self._request_get(url, params=params)
        return [Comment.construct_from(x) for x in response['comments']]
예제 #2
0
 def delete_post_comment(self, channel_id, post_id, comment_id):
     url = 'feed/{}/posts/{}/comments/{}'.format(channel_id, post_id,
                                                 comment_id)
     response = self._request_delete(url)
     return Comment.construct_from(response)
예제 #3
0
 def create_post_comment(self, channel_id, post_id, content):
     data = {'content': content}
     url = 'feed/{}/posts/{}/comments'.format(channel_id, post_id)
     response = self._request_post(url, data)
     return Comment.construct_from(response)