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(iterators): add GuildIterator.with_counts #1093

Merged
merged 6 commits into from
Aug 25, 2023

Conversation

spifory
Copy link
Member

@spifory spifory commented Jul 18, 2023

Summary

Implements discord/discord-api-docs#5628

In case you're wondering, "why is the default for with_counts False?"
Well that is because the default on the documentation false, so just for the sake of consistency, that is why the default is False.

This is a Code Change

  • I have tested my changes.
  • I have updated the documentation to reflect the changes.
  • I have run task pyright and fixed the relevant issues.

@spifory spifory force-pushed the spifory/fix/add-with-counts-param branch 2 times, most recently from 855311e to 405e5f6 Compare July 18, 2023 07:35
@spifory spifory force-pushed the spifory/fix/add-with-counts-param branch from 08b270c to 984b1c5 Compare July 18, 2023 07:37
@spifory
Copy link
Member Author

spifory commented Jul 18, 2023

I accidentally made this branch off of another branch, and not master, so that is the reason for the force-pushes

@spifory spifory added this to the 2.6 milestone Jul 18, 2023
@spifory spifory added t: enhancement Type: enhancement - new feature or request p: medium Priority: medium - should be worked on in the near future s: awaiting review Status: the issue or PR is awaiting reviews t: api coverage Type: api coverage - this adds code to cover the discord API 2.6 The issue/PR should go for the 2.6 release labels Jul 18, 2023
I'm not even sure what happened here
nextcord/iterators.py Outdated Show resolved Hide resolved
@spifory spifory requested a review from teaishealthy July 26, 2023 10:26
Copy link
Collaborator

@teaishealthy teaishealthy left a comment

Choose a reason for hiding this comment

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

is probably ok 🚀

@ooliver1 ooliver1 removed the t: enhancement Type: enhancement - new feature or request label Aug 10, 2023
nextcord/iterators.py Outdated Show resolved Hide resolved
nextcord/iterators.py Outdated Show resolved Hide resolved
nextcord/iterators.py Outdated Show resolved Hide resolved
nextcord/iterators.py Outdated Show resolved Hide resolved
@spifory spifory requested a review from EmmmaTech August 13, 2023 09:05
Copy link
Collaborator

@EmmmaTech EmmmaTech left a comment

Choose a reason for hiding this comment

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

This PR fails testing. I got an exception that yarl (which aiohttp uses for query parameters) doesn't support booleans.

You have to do something like HTTPClient.get_guild:

params = {"with_counts": int(with_counts)}

@spifory
Copy link
Member Author

spifory commented Aug 15, 2023

@emretech 244899b

@spifory spifory requested a review from EmmmaTech August 15, 2023 12:51
Copy link
Collaborator

@EmmmaTech EmmmaTech left a comment

Choose a reason for hiding this comment

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

Tested.

@ooliver1 ooliver1 merged commit a504662 into nextcord:master Aug 25, 2023
@ooliver1 ooliver1 removed the s: awaiting review Status: the issue or PR is awaiting reviews label Aug 25, 2023
@spifory spifory deleted the spifory/fix/add-with-counts-param branch August 25, 2023 23:59
EmmmaTech added a commit to EmmmaTech/nextcord that referenced this pull request Sep 17, 2023
vcokltfre pushed a commit that referenced this pull request Dec 24, 2024
* refactor!: rewrite async iterators to not use classes

* refactor!: rewrite ban & audit log iterators

* docs: represent changes in Reaction.users docstring

* refactor!: finish iterator rewrite

* style: auto fixes from pre-commit hooks

* refactor: update audit log iterators

* style: auto fixes from pre-commit hooks

* docs: add python doc references for async iterators

* style: auto fixes from pre-commit hooks

* typing: fix pyright errors

* style: auto fixes from pre-commit hooks

* fix(Guild.audit_logs): value of enum was passed into iterator

* refactor(utils)!: remove chunk in favor of as_chunks

* docs(iterators.py): add versionchanged

* refactor: rewrite iterators to reflect original code

* style: auto fixes from pre-commit hooks

* feat: port #1093

* style: auto fixes from pre-commit hooks

* style: auto fixes from pre-commit hooks

* style: resolve ruff errors

* style: auto fixes from pre-commit hooks

* refactor(utils)!: remove anext helper
nextcord maintainers have officially stated that the next version will have a 3.12 version minimum, which contains the builtin anext function.

* docs: forgot asynciter tag

* refactor: code smell, switch back to `reversed` for reversing data
in an earlier state of this pr, I switched any iterator that used  the reversed tool to sorting the list with the id as a key. however, from my own tests, this strategy does not work as expected. therefore, I have reverted it.

* style: auto fixes from pre-commit hooks

* docs: remove obsolete AsyncIterator class

* refactor(history iterator): remove obsolete 101 limit check

---------

Co-authored-by: EmreTech <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Oliver Wilkes <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.6 The issue/PR should go for the 2.6 release p: medium Priority: medium - should be worked on in the near future t: api coverage Type: api coverage - this adds code to cover the discord API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants