Skip to content

Gateway Events

Note

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


SessionStartLimit dataclass

Bases: Event, DataModel

Represents the Session Start Limit object.

total: int instance-attribute

Total remaining shards.

remaining: int instance-attribute

Shards left to connect.

reset_after: int instance-attribute

When remaining resets from now (in ms).

max_concurrency: int instance-attribute

How many shards can be started at once.

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


GatewayEvent dataclass

Bases: Event, DataModel

Represents the Gateway Event object.

url: str instance-attribute

Gateway URL to connect.

shards: int instance-attribute

Recommended shard count for the aaplication.

session_start_limit: SessionStartLimit instance-attribute

Session start info.

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