Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: expose limit parameter of fetch_following #276

Closed
wants to merge 3 commits into from

Conversation

tiagovla
Copy link
Contributor

@tiagovla tiagovla commented Mar 1, 2022

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

  • 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.
  • 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, ...)

@IAmTomahawkx
Copy link
Member

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

@tiagovla tiagovla marked this pull request as draft March 1, 2022 23:05
@tiagovla
Copy link
Contributor Author

tiagovla commented Mar 1, 2022

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 tiagovla marked this pull request as ready for review March 2, 2022 01:15
Copy link
Member

@IAmTomahawkx IAmTomahawkx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think i was unclear when I said pageable http methods, i meant the full stack, from the methods in PartialUser to the http stack. sorry for the confusion, my bad!

@IAmTomahawkx
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PartialUser.fetch_followers() not handling pagination internally
2 participants