telegramBotWithBehaviourAndFSMAndStartLongPolling

suspend fun <T : State> telegramBotWithBehaviourAndFSMAndStartLongPolling(token: String, scope: CoroutineScope? = null, apiUrl: String = telegramBotAPIDefaultUrl, builder: KtorRequestsExecutorBuilder.() -> Unit = {}, defaultExceptionsHandler: ExceptionHandler<Unit>? = null, statesManager: StatesManager<T> = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()), presetHandlers: MutableList<BehaviourWithFSMStateHandlerHolder<*, T>> = mutableListOf(), testServer: Boolean = false, block: CustomBehaviourContextReceiver<BehaviourContextWithFSMBuilder<T>, Unit>): Pair<TelegramBot, Job>

Create bot using telegramBot and start listening for updates using buildBehaviourWithFSMAndStartLongPolling. This method will launch updates retrieving via long polling inside of buildBehaviourWithFSMAndStartLongPolling

Return

Pair of TelegramBot and Job. This Job can be used to stop listening updates in your block you passed here

See also