|
2 | 2 | # https://dev.twitch.tv/docs/v5/reference/channel-feed/ |
3 | 3 |
|
4 | 4 | from twitch import keys |
5 | | -from twitch.api.parameters import Boolean |
| 5 | +from twitch.api.parameters import Boolean, Cursor |
6 | 6 | from twitch import methods |
7 | 7 | from twitch.queries import V5Query as Qry |
8 | 8 | from twitch.queries import query |
9 | 9 |
|
10 | 10 |
|
11 | 11 | @query |
12 | | -def get_posts(channel_id, limit=10, cursor=0, comments=5): |
| 12 | +def get_posts(channel_id, limit=10, cursor='MA==', comments=5): |
13 | 13 | q = Qry('feed/{channel_id}/posts') |
14 | 14 | q.add_urlkw(keys.CHANNEL_ID, channel_id) |
15 | 15 | q.add_param(keys.LIMIT, limit, 10) |
16 | | - q.add_param(keys.CURSOR, cursor, 0) |
| 16 | + q.add_param(keys.CURSOR, Cursor.validate(cursor), 'MA==') |
17 | 17 | q.add_param(keys.COMMENTS, comments, 5) |
18 | 18 | return q |
19 | 19 |
|
@@ -63,12 +63,12 @@ def delete_post_reaction(channel_id, post_id, emote_id): |
63 | 63 |
|
64 | 64 |
|
65 | 65 | @query |
66 | | -def get_comments(channel_id, post_id, limit=10, cursor=0): |
| 66 | +def get_comments(channel_id, post_id, limit=10, cursor='MA=='): |
67 | 67 | q = Qry('feed/{channel_id}/posts/{post_id}/comments') |
68 | 68 | q.add_urlkw(keys.CHANNEL_ID, channel_id) |
69 | 69 | q.add_urlkw(keys.POST_ID, post_id) |
70 | 70 | q.add_param(keys.LIMIT, limit, 10) |
71 | | - q.add_param(keys.CURSOR, cursor, 0) |
| 71 | + q.add_param(keys.CURSOR, Cursor.validate(cursor), 'MA==') |
72 | 72 | return q |
73 | 73 |
|
74 | 74 |
|
|
0 commit comments