Shard class Null safety

Shard is single connection to discord gateway. Since bots can grow big, handling thousand of guild on same websocket connections would be very hand. Traffic can be split into different connections which can be run on different processes or even different machines.

Implemented types

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
final
hashCode int
The hash code for this object. [...]
read-only, inherited
id int
Id of shard
final
manager ShardManager
Reference to ShardManager
final
onDisconnect Stream<Shard>
Emitted when the shard encounters a connection error
final, late
onMemberChunk Stream<MemberChunkEvent>
Emitted when shard receives member chunk.
final, late
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 Guild with given guildId
dispose() Future<void>
Perform cleanup
override
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