Fixed userinfo command in converters.py in examples not functioning correctly #58

Merged
Astrea49 merged 4 commits from converter-example-fix into 2.0 2021-09-21 18:52:55 +00:00
Astrea49 commented 2021-09-05 17:57:12 +00:00 (Migrated from github.com)

Summary

discord.py 2.0 did some refactoring with how avatars are handled - User.avatar no longer returns a default avatar if a user has a default avatar, instead returning None (as, well, according to the API, they have none). User.display_avatar allows default avatars to be returned, though.
userinfo in converters.py in examples did not account for this change and so could possibly break if the user mentioned for it has a default avatar. This basically fixes that by using display_avatar over avatar.

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 `discord.py 2.0` did some refactoring with how avatars are handled - `User.avatar` no longer returns a default avatar if a user has a default avatar, instead returning `None` (as, well, according to the API, they have none). `User.display_avatar` allows default avatars to be returned, though. `userinfo` in `converters.py` in `examples` did not account for this change and so could possibly break if the user mentioned for it has a default avatar. This basically fixes that by using `display_avatar` over `avatar`. ## 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, ...)
IAmTomahawkx commented 2021-09-11 21:57:32 +00:00 (Migrated from github.com)

LGTM

LGTM
IAmTomahawkx commented 2021-09-11 21:57:56 +00:00 (Migrated from github.com)

just fix the conflict

just fix the conflict
Astrea49 commented 2021-09-11 23:16:07 +00:00 (Migrated from github.com)

Fixed!

Fixed!
Sign in to join this conversation.
No description provided.