feat(role): add is_gradient and is_holographic properties#1379
feat(role): add is_gradient and is_holographic properties#1379ImChill1n wants to merge 22 commits intoDisnakeDev:masterfrom
Conversation
|
Noticed the CI is flagging issues from files I haven’t touched. Looks like some type checks are running across the whole repo. My changes passed the relevant tests and are isolated to |
onerandomusername
left a comment
There was a problem hiding this comment.
I'm not sure what happened, but somehow you had the entire repository copied within itself, and that's why tests and checks were failing. I've reverted the commits that cloned the entire repository, let me know if there's anything I can help with.
Co-authored-by: Eneg <42005170+Enegg@users.noreply.github.com> Signed-off-by: ImChill1n <69574237+ImChill1n@users.noreply.github.com>
Co-authored-by: Eneg <42005170+Enegg@users.noreply.github.com> Signed-off-by: ImChill1n <69574237+ImChill1n@users.noreply.github.com>
Co-authored-by: Eneg <42005170+Enegg@users.noreply.github.com> Signed-off-by: ImChill1n <69574237+ImChill1n@users.noreply.github.com>
This really fits better. Co-authored-by: Eneg <42005170+Enegg@users.noreply.github.com> Signed-off-by: ImChill1n <69574237+ImChill1n@users.noreply.github.com>
|
I have removed both methods and replaced with enum and style, now distinguishing custom and holographic gradient. |
Snipy7374
left a comment
There was a problem hiding this comment.
This is not consistent with the library, there's no need to introduce a new enum just for this. We usually add new enums for literal values coming from the discord API.
|
Reverted Enum changes, I have added 2 methods back. I think current version should be good. |
| def has_custom_gradient(self) -> bool: | ||
| """ | ||
| Whether the role has custom gradient. |
There was a problem hiding this comment.
I don't know about using the word "custom" here, it implies the existence of non-custom gradient
Summary
Adds
Role.is_gradientandRole.is_holographicproperties based on Discord's role styling behavior.According to the API:
Roles with only primary_color are basic, without styling.
Adding secondary_color makes the role a gradient.
Adding tertiary_color turns it into a holographic style.
These properties check role style and reflect official Discord API behavior.
Checklist
pdm lintpdm pyright