FIx _accent_colour being improperly typehinted #57

Merged
Astrea49 merged 1 commits from typehinting-fixes into 2.0 2021-09-21 18:37:28 +00:00
Astrea49 commented 2021-09-05 17:48:50 +00:00 (Migrated from github.com)

Summary

_accent_colour in discord.User was typehinted as a Optional[str] when it's stated to be an Optional[int] (or, well ?integer) by the Discord API docs and is treated by the library as an Optional[int] when User.accent_colour is called. This PR is a quick change to fix that (and make Pylance happy).

Checklist

  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the 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, ...)
## Summary `_accent_colour` in `discord.User` was typehinted as a `Optional[str]` when it's stated to be an `Optional[int]` (or, well `?integer`) by the [Discord API docs](https://discord.com/developers/docs/resources/user#user-object-user-structure) and is treated by the library as an `Optional[int]` when `User.accent_colour` is called. This PR is a quick change to fix that (and make Pylance happy). ## Checklist <!-- Put an x inside [ ] to check it, like so: [x] --> - [x] If code changes were made then they have been tested. - [ ] I have updated the documentation to reflect the 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, ...)
Gnome-py commented 2021-09-05 17:58:06 +00:00 (Migrated from github.com)

Looks good, checked at runtime and it is indeed int.

Looks good, checked at runtime and it is indeed `int`.
Sign in to join this conversation.
No description provided.