eu.vendeli.tgbot.interfaces.UserData.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of telegram-bot Show documentation
Show all versions of telegram-bot Show documentation
Telegram Bot API wrapper, with handy Kotlin DSL.
package eu.vendeli.tgbot.interfaces
import kotlinx.coroutines.Deferred
@Deprecated(
"Use UserData instead",
ReplaceWith("eu.vendeli.tgbot.interfaces.UserData"),
)
interface BotUserData : UserData
/**
* Bot user data, see [Bot context article](https://github.com/vendelieu/telegram-bot/wiki/Bot-Context)
*/
interface UserData {
/**
* Set new UserData value
*
* @param telegramId
* @param key
* @param value
*/
fun set(telegramId: Long, key: String, value: Any?)
/**
* Asynchronously set new UserData value
*
* @param telegramId
* @param key
* @param value
*/
suspend fun setAsync(telegramId: Long, key: String, value: Any?): Deferred
/**
* Get UserData value
*
* @param telegramId
* @param key
*/
fun get(telegramId: Long, key: String): T?
/**
* Asynchronously get UserData value
*
* @param telegramId
* @param key
*/
suspend fun getAsync(telegramId: Long, key: String): Deferred
/**
* Del UserData value
*
* @param telegramId
* @param key
*/
fun del(telegramId: Long, key: String)
/**
* Asynchronously delete UserData value
*
* @param telegramId
* @param key
*/
suspend fun delAsync(telegramId: Long, key: String): Deferred
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy