Types

Link copied to clipboard
class DetachEvent(val kord: Kord, val shard: Int, val customContext: Any?) : DisconnectEvent

A Gateway was detached, all resources tied to that gateway should be freed.

Link copied to clipboard
class DiscordCloseEvent(val kord: Kord, val shard: Int, val closeCode: GatewayCloseCode, val recoverable: Boolean, val customContext: Any?) : DisconnectEvent

Discord closed the connection with a closeCode.

Link copied to clipboard
class ReconnectingEvent(val kord: Kord, val shard: Int, val customContext: Any?) : DisconnectEvent

Discord requested a reconnect, the gateway will close and attempt to resume the session.

Link copied to clipboard
class RetryLimitReachedEvent(val kord: Kord, val shard: Int, val customContext: Any?) : DisconnectEvent

The Gateway has failed to establish a connection too many times and will not try to reconnect anymore. The user is free to manually connect again using Gateway.start, otherwise all resources linked to the Gateway should free and the Gateway detached.

Link copied to clipboard
class SessionReset(val kord: Kord, val shard: Int, val customContext: Any?) : DisconnectEvent

The gateway closed and will attempt to start a new session.

Link copied to clipboard
class TimeoutEvent(val kord: Kord, val shard: Int, val customContext: Any?) : DisconnectEvent

The connection was closed because of a timeout, probably due to a loss of internet connection.

Link copied to clipboard
class UserCloseEvent(val kord: Kord, val shard: Int, val customContext: Any?) : DisconnectEvent

The user closed the Gateway connection.

Link copied to clipboard
class ZombieConnectionEvent(val kord: Kord, val shard: Int, val customContext: Any?) : DisconnectEvent

Discord is no longer responding to the gateway commands, the connection will be closed and an attempt to resume the session will be made. Any commands send recently might not complete, and won't be automatically requeued.

Properties

Link copied to clipboard

A custom object that can be inserted when creating events. By default, this is just null.

Link copied to clipboard
open val gateway: Gateway

The Gateway that spawned this event.

Link copied to clipboard
abstract val kord: Kord

The kord instance that created this object.

Link copied to clipboard
abstract val shard: Int

The shard number of the gateway that spawned this event.