tock / ai.tock.bot.engine.user / UserState

UserState

data class UserState (source)

The user state.

Constructors

<init>

The user state.

UserState(creationDate: Instant = now(), flags: MutableMap<String, TimeBoxedFlag> = mutableMapOf())

Properties

botDisabled

var botDisabled: Boolean

creationDate

The user creation date.

val creationDate: Instant

flags

The flag for this user - useful to store basic information about this user.

val flags: MutableMap<String, TimeBoxedFlag>

profileLoaded

var profileLoaded: Boolean

Functions

cleanup

Cleanup the state.

fun cleanup(): Unit

getFlag

fun getFlag(flag: String): String?

hasFlag

fun hasFlag(flag: String): Boolean

removeFlag

fun removeFlag(flag: String): Unit

setFlag

fun setFlag(flag: String, timeoutInMinutes: Long, value: String): Unit
fun setFlag(flag: String, timeoutDuration: Duration, value: String): Unit

setUnlimitedFlag

fun setUnlimitedFlag(flag: String, value: String): Unit