Skip to content

hikari.events.shard_events#

Events relating to specific shards events.

MemberChunkEvent #

Bases: ShardEvent, Sequence['guilds.Member']

Event fired when a member chunk payload is received on a gateway shard.

app class-attribute instance-attribute #

app: RESTAware = field(metadata={SKIP_DEEP_COPY: True})

App instance for this application.

chunk_count class-attribute instance-attribute #

chunk_count: int = field(repr=True)

Total number of expected chunks for the request this is associated with.

chunk_index class-attribute instance-attribute #

chunk_index: int = field(repr=True)

Zero-indexed position of this within the queued up chunks for this request.

members class-attribute instance-attribute #

members: Mapping[Snowflake, Member] = field(repr=False)

Mapping of user IDs to the objects of the members in this chunk.

nonce class-attribute instance-attribute #

nonce: Optional[str] = field(repr=True)

String nonce used to identify the request member chunks are associated with.

This is the nonce value passed while requesting member chunks or None if there was no nonce passed.

not_found class-attribute instance-attribute #

not_found: Sequence[Snowflake] = field(repr=True)

Sequence of the snowflakes that were not found while making this request.

This is only applicable when user IDs are specified while making the member request the chunk is associated with.

presences class-attribute instance-attribute #

presences: Mapping[Snowflake, MemberPresence] = field(repr=False)

Mapping of user IDs to found member presence objects.

This will be empty if no presences are found or include_presences is not passed as True while requesting the member chunks.

shard class-attribute instance-attribute #

shard: GatewayShard = field(metadata={SKIP_DEEP_COPY: True})

Shard that received this event.

bitmask classmethod #

bitmask() -> int

Bitmask for this event.

dispatches classmethod #

dispatches() -> Sequence[Type[Event]]

Sequence of the event classes this event is dispatched as.

ShardConnectedEvent #

Bases: ShardStateEvent

Event fired when a shard successfully connects.

app class-attribute instance-attribute #

app: RESTAware = field(metadata={SKIP_DEEP_COPY: True})

App instance for this application.

shard class-attribute instance-attribute #

shard: GatewayShard = field(metadata={SKIP_DEEP_COPY: True})

Shard that received this event.

bitmask classmethod #

bitmask() -> int

Bitmask for this event.

dispatches classmethod #

dispatches() -> Sequence[Type[Event]]

Sequence of the event classes this event is dispatched as.

ShardDisconnectedEvent #

Bases: ShardStateEvent

Event fired when a shard disconnects.

app class-attribute instance-attribute #

app: RESTAware = field(metadata={SKIP_DEEP_COPY: True})

App instance for this application.

shard class-attribute instance-attribute #

shard: GatewayShard = field(metadata={SKIP_DEEP_COPY: True})

Shard that received this event.

bitmask classmethod #

bitmask() -> int

Bitmask for this event.

dispatches classmethod #

dispatches() -> Sequence[Type[Event]]

Sequence of the event classes this event is dispatched as.

ShardEvent #

Bases: Event, ABC

Base class for any event that was shard-specific.

app abstractmethod property #

app: RESTAware

App instance for this application.

shard abstractmethod property #

shard: GatewayShard

Shard that received this event.

bitmask classmethod #

bitmask() -> int

Bitmask for this event.

dispatches classmethod #

dispatches() -> Sequence[Type[Event]]

Sequence of the event classes this event is dispatched as.

ShardPayloadEvent #

Bases: ShardEvent

Event fired for most shard events with their raw payload.

Note

This will only be dispatched for real dispatch events received from Discord and not artificial events like the hikari.events.shard_events.ShardStateEvent events.

app class-attribute instance-attribute #

app: RESTAware = field(metadata={SKIP_DEEP_COPY: True})

App instance for this application.

name class-attribute instance-attribute #

name: str = field()

Name of the received event.

payload class-attribute instance-attribute #

payload: Mapping[str, Any] = field()

The raw payload for this event.

shard class-attribute instance-attribute #

shard: GatewayShard = field(metadata={SKIP_DEEP_COPY: True})

Shard that received this event.

bitmask classmethod #

bitmask() -> int

Bitmask for this event.

dispatches classmethod #

dispatches() -> Sequence[Type[Event]]

Sequence of the event classes this event is dispatched as.

ShardReadyEvent #

Bases: ShardStateEvent

Event fired when a shard declares it is ready.

actual_gateway_version class-attribute instance-attribute #

actual_gateway_version: int = field(repr=True)

Actual gateway version being used.

app property #

app: RESTAware

App instance for this application.

application_flags class-attribute instance-attribute #

application_flags: ApplicationFlags = field(repr=True)

Flags of the application this ready event is for.

application_id class-attribute instance-attribute #

application_id: Snowflake = field(repr=True)

ID of the application this ready event is for.

my_user class-attribute instance-attribute #

my_user: OwnUser = field(repr=True)

User for the current bot account this connection is authenticated with.

resume_gateway_url class-attribute instance-attribute #

resume_gateway_url: str = field(repr=False)

The URL to use to when reconnecting to the gateway.

session_id class-attribute instance-attribute #

session_id: str = field(repr=True)

ID for this session.

shard class-attribute instance-attribute #

shard: GatewayShard = field(metadata={SKIP_DEEP_COPY: True})

Shard that received this event.

unavailable_guilds class-attribute instance-attribute #

unavailable_guilds: Sequence[Snowflake] = field(repr=False)

Sequence of the IDs for all guilds this bot is currently in.

All guilds will start off "unavailable" and should become available after a few seconds of connecting one-by-one.

bitmask classmethod #

bitmask() -> int

Bitmask for this event.

dispatches classmethod #

dispatches() -> Sequence[Type[Event]]

Sequence of the event classes this event is dispatched as.

ShardResumedEvent #

Bases: ShardStateEvent

Event fired when a shard resumes an existing session.

app class-attribute instance-attribute #

app: RESTAware = field(metadata={SKIP_DEEP_COPY: True})

App instance for this application.

shard class-attribute instance-attribute #

shard: GatewayShard = field(metadata={SKIP_DEEP_COPY: True})

Shard that received this event.

bitmask classmethod #

bitmask() -> int

Bitmask for this event.

dispatches classmethod #

dispatches() -> Sequence[Type[Event]]

Sequence of the event classes this event is dispatched as.

ShardStateEvent #

Bases: ShardEvent, ABC

Base class for any event concerning the state/connectivity of a shard.

This currently wraps connection/disconnection/ready/resumed events only.

app abstractmethod property #

app: RESTAware

App instance for this application.

shard abstractmethod property #

shard: GatewayShard

Shard that received this event.

bitmask classmethod #

bitmask() -> int

Bitmask for this event.

dispatches classmethod #

dispatches() -> Sequence[Type[Event]]

Sequence of the event classes this event is dispatched as.