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
common
object Companion

Functions

close
Link copied to clipboard
common
abstract fun close()
copy
Link copied to clipboard
common
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
common
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
common
abstract suspend fun StatesMachine<in T>.handleState(state: T): T?
launchStateHandling
Link copied to clipboard
common
open suspend fun launchStateHandling(state: T, handlers: List<CustomizableHandlerHolder<in T, T>>): T?
open suspend fun launchStateHandling(state: T, contextUpdatesFlow: Flow<Update>, handlers: List<BehaviourWithFSMStateHandlerHolder<*, T>>): T?
start
Link copied to clipboard
common
open suspend fun start(): Job
abstract fun start(scope: CoroutineScope): Job
startChain
Link copied to clipboard
common
abstract suspend fun startChain(state: T)

Properties

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

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

inlineQueriesFlow
Link copied to clipboard
common
abstract val inlineQueriesFlow: Flow<InlineQueryUpdate>
messageMediaGroupsFlow
Link copied to clipboard
common
abstract val messageMediaGroupsFlow: Flow<MessageMediaGroupUpdate>
messagesFlow
Link copied to clipboard
common
abstract val messagesFlow: Flow<MessageUpdate>
myChatMemberUpdatesFlow
Link copied to clipboard
common
abstract val myChatMemberUpdatesFlow: Flow<MyChatMemberUpdatedUpdate>
pollAnswersFlow
Link copied to clipboard
common
abstract val pollAnswersFlow: Flow<PollAnswerUpdate>
pollsFlow
Link copied to clipboard
common
abstract val pollsFlow: Flow<PollUpdate>
preCheckoutQueriesFlow
Link copied to clipboard
common
abstract val preCheckoutQueriesFlow: Flow<PreCheckoutQueryUpdate>
scope
Link copied to clipboard
common
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
common
abstract val shippingQueriesFlow: Flow<ShippingQueryUpdate>
unknownUpdatesFlow
Link copied to clipboard
common
abstract val unknownUpdatesFlow: Flow<UnknownUpdate>

Inheritors

DefaultBehaviourContextWithFSM
Link copied to clipboard
BehaviourContextWithFSMBuilder
Link copied to clipboard