Skip to content

Role Events

Note

The following classes come from the scurrypy.events.role_events module.


RoleCreateEvent dataclass

Bases: Event, DataModel

Received when a guild role is created.

guild_id: int instance-attribute

Guild ID of the role.

role: RoleModel instance-attribute

The new role.

name: str instance-attribute

Dispatch name of event.

raw: dict instance-attribute

Event's raw JSON payload. NOT A DATACLASS.

to_dict

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

Returns:

  • dict

    serialized dataclasss


RoleUpdateEvent dataclass

Bases: Event, DataModel

Received when a guild role is updated.

guild_id: int instance-attribute

Guild ID of the role.

role: RoleModel instance-attribute

The new role.

name: str instance-attribute

Dispatch name of event.

raw: dict instance-attribute

Event's raw JSON payload. NOT A DATACLASS.

to_dict

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

Returns:

  • dict

    serialized dataclasss


RoleDeleteEvent dataclass

Bases: Event, DataModel

Received when a guild role is deleted.

guild_id: int instance-attribute

Guild ID of the role.

role_id: int instance-attribute

Role ID of the role.

name: str instance-attribute

Dispatch name of event.

raw: dict instance-attribute

Event's raw JSON payload. NOT A DATACLASS.

to_dict

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

Returns:

  • dict

    serialized dataclasss