AutoGateway

class AutoGateway(token: String, intents: GatewayIntents = GatewayIntents.NON_PRIVILEGED, restClient: RestClient, eventDispatcher: EventDispatcher, sessionDispatcher: CoroutineDispatcher = Dispatchers.Default)(source)

A utility class for automatically creating and managing sharded gateway sessions

Constructors

Link copied to clipboard
constructor(token: String, intents: GatewayIntents = GatewayIntents.NON_PRIVILEGED, restClient: RestClient, eventDispatcher: EventDispatcher, sessionDispatcher: CoroutineDispatcher = Dispatchers.Default)

Properties

Link copied to clipboard

Whether this gateway has at least one active session.

Functions

Link copied to clipboard
suspend fun block()

Blocks the current process in case your program is only the bot

Link copied to clipboard
suspend fun setStatus(status: UserStatus, isAfk: Boolean = false, idleTime: Int? = null, activity: UserStatusActivity? = null)

Sets a status message on all gateway sessions

Link copied to clipboard
suspend fun start(): AutoGateway

Starts the gateway sessions if they aren't already running

Link copied to clipboard
suspend fun stop()

Closes all the gateway sessions