Client

Note

Keep in mind that this is not generally used by you, but rather by discord.http only.

discord_http.gateway.client module

class discord_http.gateway.client.GatewayClient(bot: Client, *, cache_flags: GatewayCacheFlags | None = None, intents: Intents | None = None, automatic_shards: bool = True, shard_id: int | None = None, shard_count: int = 1, shard_ids: list[int] | None = None, max_concurrency: int | None = None)[source]

Bases: object

async change_presence(status: PlayingStatus) None[source]

Changes the presence of all shards to the specified status.

Parameters:

status (PlayingStatus) – The status to change to.

async close() None[source]

Close the gateway client

get_shard(shard_id: int) Shard | None[source]

Returns the shard object of the shard with the specified ID.

Parameters:

shard_id (int) – The ID of the shard to get.

Returns:

The shard object with the specified ID, or None if not found.

Return type:

Optional[Shard]

shard_by_guild_id(guild_id: Snowflake | int) int[source]

Returns the shard ID of the shard that the guild is in

Parameters:

guild_id (Snowflake | int) – The ID of the guild to get the shard ID of

Returns:

The shard ID of the guild

Return type:

int

start() None[source]

Start the gateway client