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(GuildIterator): fill approximate_member_count and approximate_presence_count fields when fetching Guilds #892

Merged

Conversation

Victorsitou
Copy link
Member

Summary

Guilds fetched with Client.fetch_guilds now have approximate_member_count and approximate_presence_count fields filled.

discord/discord-api-docs#5628

Checklist

  • If code changes were made, then they have been tested
    • I have updated the documentation to reflect the changes
    • I have formatted the code properly by running task lint
    • I have type-checked the code by running task pyright
  • 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, ...)

@Victorsitou Victorsitou changed the title feat: fill approximate_member_count and approximate_presence_count fields when fetching Guilds with GuildIterator feat(GuildIterator): fill approximate_member_count and approximate_presence_count fields when fetching Guilds Dec 9, 2022
@shiftinv shiftinv added t: enhancement New feature t: api support Support of Discord API features s: needs review Issue/PR is awaiting reviews s: waiting for api/docs Issue/PR is waiting for API support/documentation labels Dec 11, 2022
@shiftinv shiftinv added this to the disnake v2.8 milestone Dec 11, 2022
@shiftinv shiftinv removed this from the disnake v2.8 milestone Feb 5, 2023
Copy link
Contributor

@Skelmis Skelmis left a comment

Choose a reason for hiding this comment

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

I can't think of the use case for this param, but all other parameters to this HTTP method can be passed when this method is used in iterators. Shouldn't with_counts also be specified as an option within GuildIterator

@Victorsitou
Copy link
Member Author

I can't think of the use case for this param, but all other parameters to this HTTP method can be passed when this method is used in iterators. Shouldn't with_counts also be specified as an option within GuildIterator

If I remember correctly, we decided to keep it always as True.

@Skelmis
Copy link
Contributor

Skelmis commented Apr 9, 2023

I can't think of the use case for this param, but all other parameters to this HTTP method can be passed when this method is used in iterators. Shouldn't with_counts also be specified as an option within GuildIterator

If I remember correctly, we decided to keep it always as True.

I see, thanks.

@shiftinv
Copy link
Member

@Skelmis brings up a valid point though. I don't think there are situations where you don't want this to be set to True, but it also wouldn't hurt to make it configurable for fetch_guild and fetch_guilds just in case.

@shiftinv shiftinv removed the s: waiting for api/docs Issue/PR is waiting for API support/documentation label Jul 14, 2023
@shiftinv
Copy link
Member

the API docs PR for this got merged, could you update this one as discussed above?

@Victorsitou
Copy link
Member Author

Done. 6046af9

disnake/iterators.py Outdated Show resolved Hide resolved
changelog/892.feature.rst Outdated Show resolved Hide resolved
Co-authored-by: shiftinv <8530778+shiftinv@users.noreply.github.com>
Signed-off-by: Victor <67214928+Victorsitou@users.noreply.github.com>
Copy link
Member

@shiftinv shiftinv left a comment

Choose a reason for hiding this comment

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

lgtm, thanks!

Copy link
Member

@shiftinv shiftinv left a comment

Choose a reason for hiding this comment

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

oops, noticed one more thing

disnake/client.py Show resolved Hide resolved
disnake/client.py Show resolved Hide resolved
@Victorsitou
Copy link
Member Author

oops

Co-authored-by: shiftinv <8530778+shiftinv@users.noreply.github.com>
Signed-off-by: Victor <67214928+Victorsitou@users.noreply.github.com>
@shiftinv shiftinv merged commit 945318a into DisnakeDev:master Jul 14, 2023
23 checks passed
@shiftinv shiftinv added this to the disnake v2.10 milestone Aug 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s: needs review Issue/PR is awaiting reviews t: api support Support of Discord API features t: enhancement New feature
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants