Skip to content

Discord Role

Note

The following classes come from the scurrypy.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.

to_dict

Recursively turns the dataclass into a dictionary and drops empty fields.

Returns:

  • dict

    serialized dataclasss


RoleColors dataclass

Bases: DataModel

Parameters for setting role colors.

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.

to_dict

Recursively turns the dataclass into a dictionary and drops empty fields.

Returns:

  • dict

    serialized dataclasss