IShard class Null safety

A connection to the Discord Gateway.

One client can have multiple shards. Each shard moves the decompressing and decoding steps of the Gateway connection to their own thread which can lessen the load on the main thread for large bots which might receive thousands of events per minute.

Implemented types

Constructors

IShard()

Properties

connected bool
Returns true if shard is connected to websocket
read-only
gatewayLatency Duration
Gets the latest gateway latency.
read-only
guilds List<Snowflake>
List of handled guild ids
read-only
hashCode int
The hash code for this object.
read-only, inherited
id int
The ID of this shard.
read-only
manager IShardManager
Reference to ShardManager
read-only
onDisconnect Stream<IShard>
Emitted when the shard encounters a connection error
read-only
onMemberChunk Stream<IMemberChunkEvent>
Emitted when shard receives member chunk.
read-only
onResume Stream<IShard>
Emitted when the shard resumed its connection
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

changeVoiceState(Snowflake? guildId, Snowflake? channelId, {bool selfMute = false, bool selfDeafen = false}) → void
Updates clients voice state for IGuild with given guildId
dispose() Future<void>
Perform cleanup
inherited
guildSync() → void
Syncs all guilds
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
requestMembers(dynamic guild, {String? query, Iterable<Snowflake>? userIds, int limit = 0, bool presences = false, String? nonce}) → void
Allows to request members objects from gateway guild can be either Snowflake or Iterable
send(int opCode, dynamic d) → void
Sends WS data.
setPresence(PresenceBuilder presenceBuilder) → void
Allows to set presence for current shard.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited