DiscordShardDelegate
public protocol DiscordShardDelegate : class, DiscordTokenBearer
Declares that a type will be a shard’s delegate.
-
Used by shards to signal that they have connected.
Declaration
Swift
func shardDidConnect(_ shard: DiscordShard)Parameters
shardNumThe number of the shard that disconnected.
-
Used by shards to signal that they have disconnected
Declaration
Swift
func shardDidDisconnect(_ shard: DiscordShard)Parameters
shardNumThe number of the shard that disconnected.
-
Handles engine dispatch events. You shouldn’t need to call this method directly.
Override to provide custom engine dispatch functionality.
Declaration
Swift
func shard(_ engine: DiscordShard, didReceiveEvent event: DiscordDispatchEvent,Parameters
engineThe engine that received the event.
didReceiveEventThe event that was received.
payloadA
DiscordGatewayPayloadcontaining the dispatch information. -
Called when an engine handled a hello packet.
- gotHelloWithPayload: The hello data.
Declaration
Swift
func shard(_ engine: DiscordShard, gotHelloWithPayload payload: DiscordGatewayPayload)Parameters
engineThe engine that received the event.
DiscordShardDelegate Protocol Reference