1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-23 10:38:43 +00:00
tgbotapi/docs/dev.inmo.tgbotapi.extensions.behaviour_builder.expectations/index.md
2021-03-17 15:18:37 +00:00

167 KiB

//docs/dev.inmo.tgbotapi.extensions.behaviour_builder.expectations

Package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations

Types

Name Summary
CallbackQueryMapper [common]
Content
typealias CallbackQueryMapper<T> = T.() -> T?


ChatMemberUpdatedMapper [common]
Content
typealias ChatMemberUpdatedMapper<T> = T.() -> T?


CommonMessageToContentMapper [common]
Content
typealias CommonMessageToContentMapper<T> = suspend CommonMessage<T>.() -> T?


EventMessageToEventMapper [common]
Content
typealias EventMessageToEventMapper<T> = suspend ChatEventMessage<T>.() -> T?


InlineQueryMapper [common]
Content
typealias InlineQueryMapper<T> = T.() -> T?


NullableRequestBuilder [common]
Content
typealias NullableRequestBuilder<T> = suspend (Update) -> Request<T>?


PassportMessageMapper [common]
Content
typealias PassportMessageMapper = suspend PassportMessage.() -> PassportData


RequestBuilder [common]
Content
typealias RequestBuilder<T> = suspend (Update) -> Request<T>


Functions

Name Summary
expectFlow [common]
Content
suspend fun <T> BehaviourContext.expectFlow(initRequest: Request<>? = null, count: Int? = null, errorFactory: NullableRequestBuilder<> = { null }, cancelRequestFactory: NullableRequestBuilder<> = { null }, cancelTrigger: suspend (Update) -> Boolean = { cancelRequestFactory(it) != null }, filter: suspend (Update) -> List<T>): <T>
suspend fun <T> FlowsUpdatesFilter.expectFlow(bot: TelegramBot, initRequest: Request<
>? = null, count: Int? = null, errorFactory: NullableRequestBuilder<> = { null }, cancelRequestFactory: NullableRequestBuilder<> = { null }, cancelTrigger: suspend (Update) -> Boolean = { cancelRequestFactory(it) != null }, filter: suspend (Update) -> List<T>): <T>


expectOne [common]
Content
suspend fun <T> BehaviourContext.expectOne(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, cancelRequestFactory: NullableRequestBuilder<> = { null }, cancelTrigger: suspend (Update) -> Boolean = { cancelRequestFactory(it) != null }, filter: suspend (Update) -> T?): T
suspend fun <T> FlowsUpdatesFilter.expectOne(bot: TelegramBot, initRequest: Request<
>? = null, errorFactory: NullableRequestBuilder<> = { null }, cancelRequestFactory: NullableRequestBuilder<> = { null }, cancelTrigger: suspend (Update) -> Boolean = { cancelRequestFactory(it) != null }, filter: suspend (Update) -> T?): T


waitAnimation [common]
Content
suspend fun BehaviourContext.waitAnimation(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: CommonMessageToContentMapper<AnimationContent>? = null): List<AnimationContent>


waitAnyInlineQuery [common]
Content
suspend fun BehaviourContext.waitAnyInlineQuery(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: InlineQueryMapper<InlineQuery>? = null): List<InlineQuery>


waitAnyMediaGroupContent [common]
Content
suspend fun BehaviourContext.waitAnyMediaGroupContent(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, includeMediaGroups: Boolean = true, filter: CommonMessageToContentMapper<MediaGroupContent>? = null): List<MediaGroupContent>


waitAnyPassportMessages [common]
Content
suspend fun BehaviourContext.waitAnyPassportMessages(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: PassportMessageMapper? = null): List<PassportData>


waitAudio [common]
Content
suspend fun BehaviourContext.waitAudio(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, includeMediaGroups: Boolean = false, filter: CommonMessageToContentMapper<AudioContent>? = null): List<AudioContent>


waitAudioMediaGroupContent [common]
Content
suspend fun BehaviourContext.waitAudioMediaGroupContent(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, includeMediaGroups: Boolean = true, filter: CommonMessageToContentMapper<AudioMediaGroupContent>? = null): List<AudioMediaGroupContent>


waitBaseInlineQuery [common]
Content
suspend fun BehaviourContext.waitBaseInlineQuery(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: InlineQueryMapper<BaseInlineQuery>? = null): List<BaseInlineQuery>


waitChannelChatCreatedEvents [common]
Content
suspend fun BehaviourContext.waitChannelChatCreatedEvents(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: EventMessageToEventMapper<ChannelChatCreated>? = null): List<ChannelChatCreated>


waitChannelEvents [common]
Content
suspend fun BehaviourContext.waitChannelEvents(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: EventMessageToEventMapper<ChannelEvent>? = null): List<ChannelEvent>


waitChatEvents [common]
Content
suspend fun BehaviourContext.waitChatEvents(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: EventMessageToEventMapper<ChatEvent>? = null): List<ChatEvent>


waitChatMemberUpdated [common]
Content
suspend fun BehaviourContext.waitChatMemberUpdated(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: ChatMemberUpdatedMapper<ChatMemberUpdated>? = null): List<ChatMemberUpdated>


waitCommonChatMemberUpdated [common]
Content
suspend fun BehaviourContext.waitCommonChatMemberUpdated(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: ChatMemberUpdatedMapper<ChatMemberUpdated>? = null): List<ChatMemberUpdated>


waitCommonEvents [common]
Content
suspend fun BehaviourContext.waitCommonEvents(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: EventMessageToEventMapper<CommonEvent>? = null): List<CommonEvent>


waitContact [common]
Content
suspend fun BehaviourContext.waitContact(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: CommonMessageToContentMapper<ContactContent>? = null): List<ContactContent>


waitContentMessage [common]
Content
suspend fun BehaviourContext.waitContentMessage(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: CommonMessageToContentMapper<MessageContent>? = null): List<MessageContent>


waitDataCallbackQuery [common]
Content
suspend fun BehaviourContext.waitDataCallbackQuery(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: CallbackQueryMapper<DataCallbackQuery>? = null): List<DataCallbackQuery>


waitDeleteChatPhotoEvents [common]
Content
suspend fun BehaviourContext.waitDeleteChatPhotoEvents(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: EventMessageToEventMapper<DeleteChatPhoto>? = null): List<DeleteChatPhoto>


waitDice [common]
Content
suspend fun BehaviourContext.waitDice(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: CommonMessageToContentMapper<DiceContent>? = null): List<DiceContent>


waitDocument [common]
Content
suspend fun BehaviourContext.waitDocument(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, includeMediaGroups: Boolean = false, filter: CommonMessageToContentMapper<DocumentContent>? = null): List<DocumentContent>


waitDocumentMediaGroupContent [common]
Content
suspend fun BehaviourContext.waitDocumentMediaGroupContent(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, includeMediaGroups: Boolean = true, filter: CommonMessageToContentMapper<DocumentMediaGroupContent>? = null): List<DocumentMediaGroupContent>


waitDocumentsGroup [common]
Content
suspend fun BehaviourContext.waitDocumentsGroup(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: suspend (List<MediaGroupMessage<DocumentMediaGroupContent>>) -> Boolean? = null): List<List<DocumentMediaGroupContent>>


waitGame [common]
Content
suspend fun BehaviourContext.waitGame(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: CommonMessageToContentMapper<GameContent>? = null): List<GameContent>


waitGameShortNameCallbackQuery [common]
Content
suspend fun BehaviourContext.waitGameShortNameCallbackQuery(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: CallbackQueryMapper<GameShortNameCallbackQuery>? = null): List<GameShortNameCallbackQuery>


waitGroupChatCreatedEvents [common]
Content
suspend fun BehaviourContext.waitGroupChatCreatedEvents(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: EventMessageToEventMapper<GroupChatCreated>? = null): List<GroupChatCreated>


waitGroupEvents [common]
Content
suspend fun BehaviourContext.waitGroupEvents(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: EventMessageToEventMapper<GroupEvent>? = null): List<GroupEvent>


waitInlineMessageIdCallbackQuery [common]
Content
suspend fun BehaviourContext.waitInlineMessageIdCallbackQuery(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: CallbackQueryMapper<InlineMessageIdCallbackQuery>? = null): List<InlineMessageIdCallbackQuery>


waitInlineMessageIdDataCallbackQuery [common]
Content
suspend fun BehaviourContext.waitInlineMessageIdDataCallbackQuery(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: CallbackQueryMapper<InlineMessageIdDataCallbackQuery>? = null): List<InlineMessageIdDataCallbackQuery>


waitInlineMessageIdGameShortNameCallbackQuery [common]
Content
suspend fun BehaviourContext.waitInlineMessageIdGameShortNameCallbackQuery(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: CallbackQueryMapper<InlineMessageIdGameShortNameCallbackQuery>? = null): List<InlineMessageIdGameShortNameCallbackQuery>


waitInvoice [common]
Content
suspend fun BehaviourContext.waitInvoice(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: CommonMessageToContentMapper<InvoiceContent>? = null): List<InvoiceContent>


waitLeftChatMemberEvents [common]
Content
suspend fun BehaviourContext.waitLeftChatMemberEvents(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: EventMessageToEventMapper<LeftChatMember>? = null): List<LeftChatMember>


waitLocation [common]
Content
suspend fun BehaviourContext.waitLocation(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: CommonMessageToContentMapper<LocationContent>? = null): List<LocationContent>


waitLocationInlineQuery [common]
Content
suspend fun BehaviourContext.waitLocationInlineQuery(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: InlineQueryMapper<LocationInlineQuery>? = null): List<LocationInlineQuery>


waitMedia [common]
Content
suspend fun BehaviourContext.waitMedia(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, includeMediaGroups: Boolean = false, filter: CommonMessageToContentMapper<MediaContent>? = null): List<MediaContent>


waitMediaGroup [common]
Content
suspend fun BehaviourContext.waitMediaGroup(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: suspend (List<MediaGroupMessage<MediaGroupContent>>) -> Boolean? = null): List<List<MediaGroupContent>>


waitMessageAutoDeleteTimerChangedEvents [common]
Content
suspend fun BehaviourContext.waitMessageAutoDeleteTimerChangedEvents(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: EventMessageToEventMapper<MessageAutoDeleteTimerChanged>? = null): List<MessageAutoDeleteTimerChanged>


waitMessageCallbackQuery [common]
Content
suspend fun BehaviourContext.waitMessageCallbackQuery(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: CallbackQueryMapper<MessageCallbackQuery>? = null): List<MessageCallbackQuery>


waitMessageDataCallbackQuery [common]
Content
suspend fun BehaviourContext.waitMessageDataCallbackQuery(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: CallbackQueryMapper<MessageDataCallbackQuery>? = null): List<MessageDataCallbackQuery>


waitMessageGameShortNameCallbackQuery [common]
Content
suspend fun BehaviourContext.waitMessageGameShortNameCallbackQuery(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: CallbackQueryMapper<MessageGameShortNameCallbackQuery>? = null): List<MessageGameShortNameCallbackQuery>


waitMyChatMemberUpdated [common]
Content
suspend fun BehaviourContext.waitMyChatMemberUpdated(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: ChatMemberUpdatedMapper<ChatMemberUpdated>? = null): List<ChatMemberUpdated>


waitNewChatMembersEvents [common]
Content
suspend fun BehaviourContext.waitNewChatMembersEvents(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: EventMessageToEventMapper<NewChatMembers>? = null): List<NewChatMembers>


waitNewChatPhotoEvents [common]
Content
suspend fun BehaviourContext.waitNewChatPhotoEvents(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: EventMessageToEventMapper<NewChatPhoto>? = null): List<NewChatPhoto>


waitNewChatTitleEvents [common]
Content
suspend fun BehaviourContext.waitNewChatTitleEvents(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: EventMessageToEventMapper<NewChatTitle>? = null): List<NewChatTitle>


waitPassportMessages [common]
Content
suspend fun <O> BehaviourContext.waitPassportMessages(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, mapper: suspend PassportMessage.() -> O?): List<O>


waitPassportMessagesWith [common]
Content
inline suspend fun <T : EncryptedPassportElement> BehaviourContext.waitPassportMessagesWith(count: Int = 1, initRequest: Request<>? = null, noinline errorFactory: NullableRequestBuilder<> = { null }, noinline filter: PassportMessageMapper? = null): List<PassportData>


waitPhoto [common]
Content
suspend fun BehaviourContext.waitPhoto(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, includeMediaGroups: Boolean = false, filter: CommonMessageToContentMapper<PhotoContent>? = null): List<PhotoContent>


waitPhotoGallery [common]
Content
suspend fun BehaviourContext.waitPhotoGallery(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: suspend (List<MediaGroupMessage<PhotoContent>>) -> Boolean? = null): List<List<PhotoContent>>


waitPinnedMessageEvents [common]
Content
suspend fun BehaviourContext.waitPinnedMessageEvents(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: EventMessageToEventMapper<PinnedMessage>? = null): List<PinnedMessage>


waitPlaylist [common]
Content
suspend fun BehaviourContext.waitPlaylist(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: suspend (List<MediaGroupMessage<AudioMediaGroupContent>>) -> Boolean? = null): List<List<AudioMediaGroupContent>>


waitPoll [common]
Content
suspend fun BehaviourContext.waitPoll(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: CommonMessageToContentMapper<PollContent>? = null): List<PollContent>


waitProximityAlertTriggeredEvents [common]
Content
suspend fun BehaviourContext.waitProximityAlertTriggeredEvents(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: EventMessageToEventMapper<ProximityAlertTriggered>? = null): List<ProximityAlertTriggered>


waitSticker [common]
Content
suspend fun BehaviourContext.waitSticker(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: CommonMessageToContentMapper<StickerContent>? = null): List<StickerContent>


waitSupergroupChatCreatedEvents [common]
Content
suspend fun BehaviourContext.waitSupergroupChatCreatedEvents(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: EventMessageToEventMapper<SupergroupChatCreated>? = null): List<SupergroupChatCreated>


waitSupergroupEvents [common]
Content
suspend fun BehaviourContext.waitSupergroupEvents(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: EventMessageToEventMapper<SupergroupEvent>? = null): List<SupergroupEvent>


waitText [common]
Content
suspend fun BehaviourContext.waitText(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: CommonMessageToContentMapper<TextContent>? = null): List<TextContent>


waitUnknownCallbackQuery [common]
Content
suspend fun BehaviourContext.waitUnknownCallbackQuery(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: CallbackQueryMapper<UnknownCallbackQueryType>? = null): List<UnknownCallbackQueryType>


waitVenue [common]
Content
suspend fun BehaviourContext.waitVenue(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: CommonMessageToContentMapper<VenueContent>? = null): List<VenueContent>


waitVideo [common]
Content
suspend fun BehaviourContext.waitVideo(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, includeMediaGroups: Boolean = false, filter: CommonMessageToContentMapper<VideoContent>? = null): List<VideoContent>


waitVideoGallery [common]
Content
suspend fun BehaviourContext.waitVideoGallery(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: suspend (List<MediaGroupMessage<VideoContent>>) -> Boolean? = null): List<List<VideoContent>>


waitVideoNote [common]
Content
suspend fun BehaviourContext.waitVideoNote(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: CommonMessageToContentMapper<VideoNoteContent>? = null): List<VideoNoteContent>


waitVisualGallery [common]
Content
suspend fun BehaviourContext.waitVisualGallery(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: suspend (List<MediaGroupMessage<VisualMediaGroupContent>>) -> Boolean? = null): List<List<VisualMediaGroupContent>>


waitVisualMediaGroupContent [common]
Content
suspend fun BehaviourContext.waitVisualMediaGroupContent(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, includeMediaGroups: Boolean = true, filter: CommonMessageToContentMapper<VisualMediaGroupContent>? = null): List<VisualMediaGroupContent>


waitVoice [common]
Content
suspend fun BehaviourContext.waitVoice(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: CommonMessageToContentMapper<VoiceContent>? = null): List<VoiceContent>


waitVoiceChatEndedEvents [common]
Content
suspend fun BehaviourContext.waitVoiceChatEndedEvents(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: EventMessageToEventMapper<VoiceChatEnded>? = null): List<VoiceChatEnded>


waitVoiceChatEvents [common]
Content
suspend fun BehaviourContext.waitVoiceChatEvents(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: EventMessageToEventMapper<VoiceChatEvent>? = null): List<VoiceChatEvent>


waitVoiceChatParticipantsInvitedEvents [common]
Content
suspend fun BehaviourContext.waitVoiceChatParticipantsInvitedEvents(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: EventMessageToEventMapper<VoiceChatParticipantsInvited>? = null): List<VoiceChatParticipantsInvited>


waitVoiceChatStartedEvents [common]
Content
suspend fun BehaviourContext.waitVoiceChatStartedEvents(initRequest: Request<>? = null, errorFactory: NullableRequestBuilder<> = { null }, count: Int = 1, filter: EventMessageToEventMapper<VoiceChatStarted>? = null): List<VoiceChatStarted>