Skip to content

Discord Role

Note

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


GuildRolePart dataclass

Bases: DataModel

Parameters for creating a role.

name: str = None class-attribute instance-attribute

Name of the role.

colors: GuildRoleColorsPart = None class-attribute instance-attribute

Colors of the role.

icon: Optional[ImageDataPart] = None class-attribute instance-attribute

Icon of the role (if guild has ROLE_ICONS feature).

permissions: int = None class-attribute instance-attribute

Permission bit set. [INT_LIMIT]

hoist: bool = None class-attribute instance-attribute

If the role is pinned in the user listing.

mentionable: bool = None 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


GuildRoleColorsPart dataclass

Bases: DataModel

Parameters for setting role colors.

primary_color: int = None class-attribute instance-attribute

Primary color of the role.

secondary_color: int = None class-attribute instance-attribute

Secondary color of the role. Creates a gradient.

tertiary_color: int = None class-attribute 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