Skip to content

Discord Role

Note

The following classes come from the discord.parts.role package.


Role dataclass

Bases: DataModel

Parameters for creating/editing a role.

colors: RoleColors instance-attribute

Colors of the role.

name: str = None class-attribute instance-attribute

Name of the role.

permissions: int = 0 class-attribute instance-attribute

Permission bit set.

hoist: bool = False class-attribute instance-attribute

If the role is pinned in the user listing.

mentionable: bool = False class-attribute instance-attribute

If the role is mentionable.

unicode_emoji: Optional[str] = None class-attribute instance-attribute

Unicode emoji of the role.

set_color

Set this role's color with a hex. (format: #FFFFFF)

Parameters:

  • hex (str) –

    color as a hex code

Returns:


RoleColors dataclass

Bases: DataModel

Role color data.

primary_color: int instance-attribute

Primary color of the role.

secondary_color: int instance-attribute

Secondary color of the role. Creates a gradient.

tertiary_color: int instance-attribute

Tertiary color of the role. Creates a holographic style.