Skip to content

Commit 9af49cb

Browse files
authored
fix(http): cursor was never sent (#274)
* fix(http): cursor was never sent * docs: update changelog * ci: format with black * ci: format with black 22.1.0
1 parent d69a433 commit 9af49cb

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

docs/changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
- Add `is_broadcaster` check to `PartialChatter` class. This is accessible as `ctx.author.is_broadcaster`
1616
- :func:`User.fetch_follow` will now return None if the FollowEvent does not exists
1717
- TwitchIO will now correctly handle error raised when only the prefix is typed in chat
18+
- Fix paginate logic in :func:`TwitchHTTP.request`
1819

1920
- ext.commands
2021
- Fixed an issue (`GH#273 <https://github.com/TwitchIO/TwitchIO/issues/273>`_) where cog listeners were not ejected when unloading a module

twitchio/http.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -178,18 +178,10 @@ def get_limit():
178178
path = copy.copy(route.path)
179179

180180
if limit is not None and paginate:
181+
q = route.query or []
181182
if cursor is not None:
182-
if route.query:
183-
q = [("after", cursor), *route.query]
184-
else:
185-
q = [("after", cursor)]
186-
path = path.with_query(q)
187-
188-
if route.query:
189-
q = [("first", get_limit()), *route.query]
190-
else:
191-
q = [("first", get_limit())]
192-
183+
q = [("after", cursor), *q]
184+
q = [("first", get_limit()), *q]
193185
path = path.with_query(q)
194186

195187
body, is_text = await self._request(route, path, headers)

0 commit comments

Comments
 (0)