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

fix: always set Guild._member_count #2145

Merged
merged 6 commits into from
Jun 25, 2023

Conversation

NeloBlivion
Copy link
Member

@NeloBlivion NeloBlivion commented Jun 24, 2023

Summary

Previously, if a guild's member_count wasn't provided from the API (e.g. when using fetch_guild) the _member_count attribute was never set. This makes sure it's set regardless, and adjust other functions in the library to make use of this instead of using getattr or try/except.
Fixes #2136

Information

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

Checklist

  • I have searched the open pull requests for duplicates.
  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • If type: ignore comments were used, a comment is also left explaining why.
  • I have updated the changelog to include these changes.

@codecov
Copy link

codecov bot commented Jun 24, 2023

Codecov Report

Merging #2145 (ea3c81d) into master (c5345d8) will increase coverage by 0.01%.
The diff coverage is 0.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2145      +/-   ##
==========================================
+ Coverage   33.86%   33.87%   +0.01%     
==========================================
  Files         109      109              
  Lines       22361    22353       -8     
==========================================
  Hits         7573     7573              
+ Misses      14788    14780       -8     
Flag Coverage Δ
macos-latest-3.10 33.85% <0.00%> (+0.01%) ⬆️
macos-latest-3.11 33.85% <0.00%> (+0.01%) ⬆️
macos-latest-3.8 33.86% <0.00%> (+0.01%) ⬆️
macos-latest-3.9 33.86% <0.00%> (+0.01%) ⬆️
ubuntu-latest-3.10 33.85% <0.00%> (+0.01%) ⬆️
ubuntu-latest-3.11 33.85% <0.00%> (+0.01%) ⬆️
ubuntu-latest-3.8 33.86% <0.00%> (+0.01%) ⬆️
ubuntu-latest-3.9 33.86% <0.00%> (+0.01%) ⬆️
windows-latest-3.10 33.85% <0.00%> (+0.01%) ⬆️
windows-latest-3.11 33.85% <0.00%> (+0.01%) ⬆️
windows-latest-3.8 33.86% <0.00%> (+0.01%) ⬆️
windows-latest-3.9 33.86% <0.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
discord/guild.py 23.72% <0.00%> (+0.10%) ⬆️
discord/state.py 20.11% <0.00%> (+0.06%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c5345d8...ea3c81d. Read the comment docs.

@Dorukyum
Copy link
Member

Please add a changelog entry.

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