ClassData

interface ClassData<T> : BotContext<T>

Bot class data, see Bot context article

Inheritors

Functions

Link copied to clipboard
abstract suspend fun clearAll(telegramId: Long)

Clear all class data entries. Used to remove previous context data.

Link copied to clipboard
abstract fun del(telegramId: Long, key: String)

Delete value

Link copied to clipboard
abstract suspend fun delAsync(telegramId: Long, key: String): Deferred<Boolean>

Asynchronously delete value

Link copied to clipboard
open operator fun get(user: User, key: String): T?

Shortcut operator function for getting value.

abstract operator fun get(telegramId: Long, key: String): T?

Get value

Link copied to clipboard
abstract suspend fun getAsync(telegramId: Long, key: String): Deferred<T?>

Asynchronously get value

Link copied to clipboard
open operator fun set(user: User, key: String, value: T?)

Shortcut operator function for value setting.

abstract operator fun set(telegramId: Long, key: String, value: T?)

Set new value.

Link copied to clipboard
abstract suspend fun setAsync(telegramId: Long, key: String, value: T?): Deferred<Boolean>

Asynchronously set new value