Behaviour Context
This class contains all necessary tools for work with bots and especially buildBehaviour
See also
Functions
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
Properties
Inheritors
Extensions
Use this method in case you wish to make some additional actions with flowUpdatesFilter.
Creates BehaviourContextWithFSM via creating of DefaultBehaviourContext with this as TelegramBot, scope as target scope for that DefaultBehaviourContext and upstreamUpdatesFlow. Pass statesManager to customize some internal logic of states changes. Pass presetHandlers in case you have some list of BehaviourWithFSMStateHandlerHolder with presets.
Creates BehaviourContextWithFSM via creating of DefaultBehaviourContext with this as TelegramBot, scope as target scope for that DefaultBehaviourContext and FlowsUpdatesFilter.allUpdatesFlow of flowUpdatesFilter as DefaultBehaviourContext.upstreamUpdatesFlow. Pass statesManager to customize some internal logic of states changes. Pass presetHandlers in case you have some list of BehaviourWithFSMStateHandlerHolder with presets. Use this method in case you wish to make some additional actions with flowUpdatesFilter.
Use buildBehaviourWithFSM to create BehaviourContextWithFSM and launch getting of updates using longPolling. For longPolling will be used result BehaviourContextWithFSM for both parameters flowsUpdatesFilter and scope
Use this method to build bot behaviour and run it via long polling. In case you wish to get FlowsUpdatesFilter for additional manipulations, you must provide external FlowsUpdatesFilter in other buildBehaviour function.
Send media group via sendMediaGroup extension with edited entities of first messages element. Other elements will be copied as they are
Send media group via sendMediaGroup extension with edited entities of first messages element. Other elements will be copied as they are
Send media group via sendMediaGroup extension with edited entities of first messages element. Other elements will be copied as they are
Send media group via sendMediaGroup extension with edited entities of first messages element. Other elements will be copied as they are
Use this extension when you want to follow LiveLocation until it will became StaticLocation. This method is synchronous. You may use something like kotlinx.coroutines.launch or kotlinx.coroutines.async to run it asynchronously
Will cast incoming dev.inmo.tgbotapi.types.chat.ExtendedChat to a ExtendedPublicChat with unsafe operator "as"
Will cast incoming dev.inmo.tgbotapi.types.chat.ExtendedChat to a ExtendedChannelChat with unsafe operator "as"
Will cast incoming dev.inmo.tgbotapi.types.chat.ExtendedChat to a ExtendedChannelChatImpl with unsafe operator "as"
Will cast incoming dev.inmo.tgbotapi.types.chat.ExtendedChat to a ExtendedGroupChat with unsafe operator "as"
Will cast incoming dev.inmo.tgbotapi.types.chat.ExtendedChat to a ExtendedGroupChatImpl with unsafe operator "as"
Will cast incoming dev.inmo.tgbotapi.types.chat.ExtendedChat to a ExtendedSupergroupChat with unsafe operator "as"
Will cast incoming dev.inmo.tgbotapi.types.chat.ExtendedChat to a ExtendedSupergroupChatImpl with unsafe operator "as"
Will cast incoming dev.inmo.tgbotapi.types.chat.ExtendedChat to a ExtendedPrivateChat with unsafe operator "as"
Will cast incoming dev.inmo.tgbotapi.types.chat.ExtendedChat to a ExtendedPrivateChatImpl with unsafe operator "as"
Will cast incoming dev.inmo.tgbotapi.types.chat.ExtendedChat to a ExtendedUser with unsafe operator "as"
Will sendLiveLocation with the first EditLiveLocationInfo data and update than. Each liveTimeMillis passing, the message will be sent again and new edits will be applied to the new message
Will apply Flow.map to the locationsFlow to create EditLiveLocationInfo and pass the result flow to the handleLiveLocation with Flow typed by EditLiveLocationInfo
Shortcut for photoMessages
Will startGettingOfUpdatesByLongPolling using incoming flowsUpdatesFilter. It is assumed that you ALREADY CONFIGURE all updates receivers, because this method will trigger getting of updates and.
Will enable longPolling by creating FlowsUpdatesFilter with flowsUpdatesFilterUpdatesKeeperCount as an argument and applied flowUpdatesPreset. It is assumed that you WILL CONFIGURE all updates receivers in flowUpdatesPreset, because of after flowUpdatesPreset method calling will be triggered getting of updates.
Will use handleLiveLocation with replying to message each time new message will be sent by live location update
Will use handleLiveLocation with replying to message each time new message will be sent by live location update
Will execute sendBotAction request
Will execute sendAnimation request
Will execute sendAudio request
Will execute sendContact request
Will execute sendDice request
Will execute sendDocument request
Will execute sendGame request
Will execute sendInvoice request
Will execute sendStaticLocation request
Will execute sendTextMessage request
Will execute sendPhoto request
Will execute sendRegularPoll request
Will execute sendQuizPoll request
Will execute sendSticker request
Will execute sendVenue request
Will execute sendVideo request
Will execute sendVideoNote request
Will execute sendVoice request
Use this method to send information about webhook (like url)
Use this method to send information about webhook (like url and certificate)
Setting up ktor server, set webhook info via SetWebhookRequest request.
This method will cancel ALL subsequent contexts, expectations and waiters
Create UpdateReceiver object which will correctly accumulate updates and send into output updates which INCLUDE dev.inmo.tgbotapi.types.update.MediaGroupUpdates.MediaGroupUpdates.
Will filter all the messages and include required commands with commandRegex.
This wait will be triggered only for stopped polls and polls, which are sent by the bot
This wait will be triggered only for stopped polls and polls, which are sent by the bot
This wait will be triggered only for stopped polls and polls, which are sent by the bot