Added (back?) support for hexes without a prefix for commands.ColourConverter #52

Open
Astrea49 wants to merge 1 commits from Astrea49/colour-tweaks into 2.0
Astrea49 commented 2021-09-04 04:50:32 +00:00 (Migrated from github.com)

Summary

Back in the day (before 1.7), discord.py used to allow hexes without a prefix (like, for example, FF0800), and it would parse just fine. This feature was never documented, per se, but it worked.
This commit changed all of that, making it so either a # or a 0x was required due to a rewrite in the logic of the conversion.

This PR attempts to allow hexes without a prefix to work again. Not sure if it should have a versionchanged or this is a great idea - let me know if there's anything wrong with this PR! Admittedly, the change is somewhat hacky anyways.

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 Back in the day (before 1.7), discord.py used to allow hexes without a prefix (like, for example, `FF0800`), and it would parse just fine. This feature was never *documented*, per se, but it worked. [This commit](https://github.com/Rapptz/discord.py/commit/a0404807d5e20ad6a5fae52e5d3a51cbba8e0c63) changed all of that, making it so either a `#` or a `0x` was required due to a rewrite in the logic of the conversion. This PR attempts to allow hexes without a prefix to work again. Not sure if it should have a `versionchanged` or this is a great idea - let me know if there's anything wrong with this PR! Admittedly, the change is somewhat hacky anyways. ## Checklist <!-- Put an x inside [ ] to check it, like so: [x] --> - [x] If code changes were made then they have been tested. - [x] 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 (Migrated from github.com) approved these changes 2021-09-04 04:53:11 +00:00
IAmTomahawkx (Migrated from github.com) left a comment

Seems fine to me, thanks

Seems fine to me, thanks
This pull request has changes conflicting with the target branch.
  • discord/ext/commands/converter.py

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin Astrea49/colour-tweaks:Astrea49/colour-tweaks
git checkout Astrea49/colour-tweaks
Sign in to join this conversation.
No description provided.