BehaviourContextWithFSM

interface BehaviourContextWithFSM<T : State> : BehaviourContext, StatesMachine<T>

Interface which combine BehaviourContext and StatesMachine. Subcontext of triggers and states contexts must have one common flow of updates and must not lose updates between updates

See also

Types

Companion
Link copied to clipboard
object Companion

Functions

close
Link copied to clipboard
expect abstract fun close()
copy
Link copied to clipboard
abstract override fun copy(bot: TelegramBot, scope: CoroutineScope, broadcastChannelsSize: Int, onBufferOverflow: BufferOverflow, upstreamUpdatesFlow: Flow<Update>?, updatesFilter: BehaviourContextAndTypeReceiver<Boolean, Update>?): BehaviourContextWithFSM<T>
execute
Link copied to clipboard
abstract suspend fun <T : Any> execute(request: Request<T>): T

Unsafe execution of incoming request. Can throw almost any exception. So, it is better to use something like dev.inmo.tgbotapi.extensions.utils.shortcuts.executeAsync or dev.inmo.tgbotapi.extensions.utils.shortcuts.executeUnsafe

handleState
Link copied to clipboard
abstract suspend fun StatesMachine<in T>.handleState(state: T): T?
launchStateHandling
Link copied to clipboard
open suspend fun launchStateHandling(state: T, handlers: List<CheckableHandlerHolder<in T, T>>): T?
open suspend fun launchStateHandling(state: T, contextUpdatesFlow: Flow<Update>, handlers: List<BehaviourWithFSMStateHandlerHolder<*, T>>): T?
start
Link copied to clipboard
open suspend fun start(): Job
abstract fun start(scope: CoroutineScope): Job
startChain
Link copied to clipboard
abstract suspend fun startChain(state: T)

Properties

allowedUpdates
Link copied to clipboard
open override val allowedUpdates: List<String>
allUpdatesFlow
Link copied to clipboard
abstract val allUpdatesFlow: Flow<Update>
abstract val allUpdatesWithoutMediaGroupsGroupingFlow: Flow<Update>
asUpdateReceiver
Link copied to clipboard
abstract val asUpdateReceiver: UpdateReceiver<Update>
bot
Link copied to clipboard
open val bot: TelegramBot
callbackQueriesFlow
Link copied to clipboard
abstract val callbackQueriesFlow: Flow<CallbackQueryUpdate>
channelPostMediaGroupsFlow
Link copied to clipboard
abstract val channelPostMediaGroupsFlow: Flow<ChannelPostMediaGroupUpdate>
channelPostsFlow
Link copied to clipboard
abstract val channelPostsFlow: Flow<ChannelPostUpdate>
chatJoinRequestUpdateFlow
Link copied to clipboard
abstract val chatJoinRequestUpdateFlow: Flow<ChatJoinRequestUpdate>
chatMemberUpdatesFlow
Link copied to clipboard
abstract val chatMemberUpdatesFlow: Flow<CommonChatMemberUpdatedUpdate>
chosenInlineResultsFlow
Link copied to clipboard
abstract val chosenInlineResultsFlow: Flow<ChosenInlineResultUpdate>
coroutineContext
Link copied to clipboard
abstract val coroutineContext: CoroutineContext
editedChannelPostMediaGroupsFlow
Link copied to clipboard
abstract val editedChannelPostMediaGroupsFlow: Flow<EditChannelPostMediaGroupUpdate>
editedChannelPostsFlow
Link copied to clipboard
abstract val editedChannelPostsFlow: Flow<EditChannelPostUpdate>
editedMessageMediaGroupsFlow
Link copied to clipboard
abstract val editedMessageMediaGroupsFlow: Flow<EditMessageMediaGroupUpdate>
editedMessagesFlow
Link copied to clipboard
abstract val editedMessagesFlow: Flow<EditMessageUpdate>
flowsUpdatesFilter
Link copied to clipboard
open val flowsUpdatesFilter: FlowsUpdatesFilter

This parameter will be used to subscribe on different types of update

inlineQueriesFlow
Link copied to clipboard
abstract val inlineQueriesFlow: Flow<InlineQueryUpdate>
messageMediaGroupsFlow
Link copied to clipboard
abstract val messageMediaGroupsFlow: Flow<MessageMediaGroupUpdate>
messagesFlow
Link copied to clipboard
abstract val messagesFlow: Flow<MessageUpdate>
myChatMemberUpdatesFlow
Link copied to clipboard
abstract val myChatMemberUpdatesFlow: Flow<MyChatMemberUpdatedUpdate>
pollAnswersFlow
Link copied to clipboard
abstract val pollAnswersFlow: Flow<PollAnswerUpdate>
pollsFlow
Link copied to clipboard
abstract val pollsFlow: Flow<PollUpdate>
preCheckoutQueriesFlow
Link copied to clipboard
abstract val preCheckoutQueriesFlow: Flow<PreCheckoutQueryUpdate>
scope
Link copied to clipboard
open val scope: CoroutineScope

Will be used for creating of some subscriptions inside of methods, updates listening and different other things in context of working with CoroutineScope and coroutines.

shippingQueriesFlow
Link copied to clipboard
abstract val shippingQueriesFlow: Flow<ShippingQueryUpdate>
unknownUpdatesFlow
Link copied to clipboard
abstract val unknownUpdatesFlow: Flow<UnknownUpdate>

Inheritors

DefaultBehaviourContextWithFSM
Link copied to clipboard
BehaviourContextWithFSMBuilder
Link copied to clipboard