start

inline suspend fun Gateway.start(token: String, config: GatewayConfigurationBuilder.() -> Unit = {})(source)

Starts a reconnecting gateway connection with the given parameters. This function will suspend until the lifecycle of the gateway has ended.

gateway.start("your_token") {
shard = DiscordShard(0,1)

presence {
afk = false
status = Status.Online
watching("you :eyes:")
}

}

//gateway has disconnected

Parameters

token

The Discord token of the bot.

config

additional configuration for the gateway.