TwitchIO icon indicating copy to clipboard operation
TwitchIO copied to clipboard

feat: expose limit parameter of fetch_following

Open tiagovla opened this issue 3 years ago • 2 comments

Pull request summary

This PR addresses the issue #216 exposing the parameter limit. It needs the PR #274 to work properly.

# test.py
import twitchio
import asyncio


async def main():
    token = "<token>"

    client = twitchio.Client(token=token)
    try:
        user = (await client.fetch_users(names=["s4"]))[0]
        following = await user.fetch_following(limit=400)
        names = set([f.to_user.name for f in following])
        print(len(following), len(names))  # 400, 100
    finally:
        if client._http.session:
            await client._http.session.close()


if __name__ == "__main__":
    """Run test."""

    loop = asyncio.new_event_loop()
    asyncio.set_event_loop(loop)
    loop.run_until_complete(main())

Checklist

  • [x] If code changes were made then they have been tested.
    • [ ] I have updated the documentation to reflect the changes.
    • [ ] I have updated the changelog with a quick recap of my changes.
  • [x] This PR fixes an issue.
  • [ ] This PR adds something new (e.g. new method or parameters).
  • [ ] This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • [ ] This PR is not a code change (e.g. documentation, README, ...)

tiagovla avatar Mar 01 '22 21:03 tiagovla

This is something that would have to be implemented on all pageable http methods for it to be considered

IAmTomahawkx avatar Mar 01 '22 22:03 IAmTomahawkx

This is something that would have to be implemented on all pageable http methods for it to be considered

I converted it to draft for now. I will check how many pageable http methods there are later.

tiagovla avatar Mar 01 '22 23:03 tiagovla

Hello, I'm closing this due to inactivity. If you wish to continue working on this, feel free to send a message or open a new PR. as it stands i believe this may be superseded by #359 so it might not be required

IAmTomahawkx avatar Jan 13 '23 09:01 IAmTomahawkx