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, *, cache_flags=None, intents=None, automatic_shards=True, shard_id=None, shard_count=1, shard_ids=None, max_concurrency=None)

Bases: object

Parameters:
async change_presence(status) None

Changes the presence of all shards to the specified status.

Parameters:

status (PlayingStatus) – The status to change to.

Return type:

None

async close() None

Close the gateway client.

Return type:

None

get_shard(shard_id) Shard | None

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

Parameters:

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

Return type:

Shard | None

Returns:

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

shard_by_guild_id(guild_id) int

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

Return type:

int

Returns:

The shard ID of the guild

start() None

Start the gateway client.

Return type:

None