BehaviourContextWithFSMBuilder

class BehaviourContextWithFSMBuilder<T : State> : BehaviourContextWithFSM<T>

Functions

add
Link copied to clipboard
common
fun <I : T> add(kClass: KClass<I>, handler: BehaviourWithFSMStateHandler<I, T>)

Add NON STRICT handler to list of available in future BehaviourContextWithFSM. Non strict means that for input State will be used KClass.isInstance and any inheritor of kClass will pass this requirement

addStrict
Link copied to clipboard
common
fun <I : T> addStrict(kClass: KClass<I>, handler: BehaviourWithFSMStateHandler<I, T>)

Add STRICT handler to list of available in future BehaviourContextWithFSM. Strict means that for input State will be used State::class == kClass and any State with exactly the same type will pass requirements

close
Link copied to clipboard
common
open override fun close()
copy
Link copied to clipboard
common
open 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
open suspend override 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
open suspend override fun StatesMachine<in T>.handleState(state: T): T?
launchStateHandling
Link copied to clipboard
common
open suspend override fun launchStateHandling(state: T, handlers: List<CheckableHandlerHolder<in T, T>>): T?
open suspend override fun launchStateHandling(state: T, contextUpdatesFlow: Flow<Update>, handlers: List<BehaviourWithFSMStateHandlerHolder<*, T>>): T?
onStateOrSubstate
Link copied to clipboard
common
inline fun <I : T> onStateOrSubstate(handler: BehaviourWithFSMStateHandler<I, T>)

Add NON STRICT handler to list of available in future BehaviourContextWithFSM. Non strict means that for input State will be used KClass.isInstance and any inheritor of kClass will pass this requirement

start
Link copied to clipboard
common
open suspend override fun start(): Job
open override fun start(scope: CoroutineScope): Job
startChain
Link copied to clipboard
common
open suspend override fun startChain(state: T)
strictlyOn
Link copied to clipboard
common
inline fun <I : T> strictlyOn(handler: BehaviourWithFSMStateHandler<I, T>)

Add STRICT handler to list of available in future BehaviourContextWithFSM. Strict means that for input State will be used State::class == kClass and any State with exactly the same type will pass requirements

Properties

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

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

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