-
Notifications
You must be signed in to change notification settings - Fork 144
feat(role): add is_gradient and is_holographic properties #1379
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
base: master
Are you sure you want to change the base?
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 |
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.
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 <[email protected]> Signed-off-by: ImChill1n <[email protected]>
Co-authored-by: Eneg <[email protected]> Signed-off-by: ImChill1n <[email protected]>
Co-authored-by: Eneg <[email protected]> Signed-off-by: ImChill1n <[email protected]>
This really fits better. Co-authored-by: Eneg <[email protected]> Signed-off-by: ImChill1n <[email protected]>
I have removed both methods and replaced with enum and style, now distinguishing custom and holographic gradient. |
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.
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. |
Co-authored-by: Snipy7374 <[email protected]> Signed-off-by: ImChill1n <[email protected]>
def has_custom_gradient(self) -> bool: | ||
""" | ||
Whether the role has custom gradient. |
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.
I don't know about using the word "custom" here, it implies the existence of non-custom gradient
Summary
Adds
Role.is_gradient
andRole.is_holographic
properties 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 lint
pdm pyright