Skip to content
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/1379.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Adds Role.is_gradient and Role.is_holographic properties to check whether a role is gradient or holographic.
20 changes: 20 additions & 0 deletions disnake/role.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,26 @@ def tertiary_color(self) -> Optional[Colour]:
"""
return self.tertiary_colour

@property
def is_gradient(self) -> bool:
"""Whether the role is gradient.

.. versionadded:: 2.11.1

:return type: :class:`bool`
"""
return self.secondary_color is not None and self.tertiary_color is None

@property
def is_holographic(self) -> bool:
"""Whether the role is holographic.

.. versionadded:: 2.11.1

:return type: :class:`bool`
"""
return self.tertiary_color is not None

@property
def icon(self) -> Optional[Asset]:
"""Optional[:class:`Asset`]: Returns the role's icon asset, if available.
Expand Down
Loading