-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Make Guild.member_count
Optional
#7605
Conversation
I don't know how I feel about the type of |
Unless I'm misremembering, the only time |
I don't think 0 makes a lot of sense here. The guild member count is still above 0, regardless of whether it is unavailable or not. |
None will make typing UX not amazing. |
I am aware that marking this attribute as I'd rather a little extra work to appease a type checker than it just dying, personally. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs updating migrating.rst
That's why 0 is a good middle ground. In the rare event it isn't provided, it being 0 shouldn't be a problem. Even name defaults to an empty string. |
Summary
According to multiple reports, this key is not always present in a guild payload. Currently the library only sets this attribute if it is not
None
resulting in a rare error during startup or when retrieving guilds.Potentially a fix for #6652?
I have made this attribute and property
Optional
as a result, to avoid anAttributeError
.Sadly I cannot test this, due to potentially requiring an "unavailable" guild.
Checklist