Keying

enum Keying : Enum<Keying>

How a transport turns an incoming update into a ConversationKey.

The default is PerUserInChat and that is a deliberate choice rather than a neutral one: it is correct in a group and indistinguishable from PerChat in a private chat, where the only sender is the only member. A bot that genuinely wants shared state in a group asks for PerChat; a bot that wants something else again — per forum topic, say — builds the key itself and calls Telek.onInput directly, which is what the input adapters are public for.

Entries

Link copied to clipboard

chatId plus the sender. An update with no identifiable sender — a channel post, an automatic forward — has no user to key by and falls back to the chat.

Link copied to clipboard

chatId alone, whoever sent it.

Properties

Link copied to clipboard

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Link copied to clipboard
expect val name: String
Link copied to clipboard
expect val ordinal: Int

Functions

Link copied to clipboard
fun key(chatId: Long, userId: Long?): ConversationKey
Link copied to clipboard
fun valueOf(value: String): Keying

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.