connect

fun BehaviourContext.connect(telek: Telek, contextSource: KtgContextSource, keying: Keying, answerCallbackQueries: Boolean = true)

Adapts ktgbotapi updates into telek io.github.youndie.telek.Inputs and feeds the behaviour context's dev.inmo.tgbotapi.bot.TelegramBot to contextSource.

Subscribes text, data callbacks, photos, documents, contacts and locations. A content type telek does not model is not subscribed and therefore never reaches the FSM — a bot that needs one wires its own trigger and calls io.github.youndie.telek.Telek.onInput with an Input of its own; the adapters here are public so that path reuses them.

connect and ktgEffectExecutor must be given the same KtgContextSource instance.

Parameters

answerCallbackQueries

answers every handled callback query so Telegram stops the client's spinner (kotlin-telegram-bot does this on its own; ktgbotapi doesn't). Turn it off if a dispatcher answers with its own text/alert.

keying

how an update becomes the io.github.youndie.telek.ConversationKey the state is filed under, and required on purpose. Keying.PerUserInChat is what a wizard wants and what a group requires; Keying.PerChat is for state the whole chat shares — a poll, a group game.

It has no default because a default made this decision silently for a bot that merely upgraded: the key changed under it, stored state stopped being found, and a bot that also feeds some inputs through Telek.onInput directly ended up with one conversation split across two keys in the same process. None of that has a symptom anyone would trace back to a parameter they never typed. A required parameter costs a new bot one word and turns that into a compile error at the exact seam that decides it.