All Downloads are FREE. Search and download functionalities are using the official Maven repository.

eu.vendeli.tgbot.interfaces.UserData.kt Maven / Gradle / Ivy

There is a newer version: 6.6.0
Show newest version
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