Package dev.inmo.tgbotapi.extensions.utils.shortcuts

Functions

animationMessages
Link copied to clipboard
fun Flow<BaseSentMessageUpdate>.animationMessages(): Flow<ContentMessage<AnimationContent>>
fun FlowsUpdatesFilter.animationMessages(scopeToIncludeChannels: CoroutineScope? = null): Flow<ContentMessage<AnimationContent>>
audioMessages
Link copied to clipboard
fun Flow<BaseSentMessageUpdate>.audioMessages(): Flow<ContentMessage<AudioContent>>
fun FlowsUpdatesFilter.audioMessages(scopeToIncludeChannels: CoroutineScope? = null): Flow<ContentMessage<AudioContent>>
audioMessagesWithMediaGroups
Link copied to clipboard
fun FlowsUpdatesFilter.audioMessagesWithMediaGroups(scopeToIncludeChannels: CoroutineScope? = null): Flow<ContentMessage<AudioContent>>
channelCreatedEvents
Link copied to clipboard
inline fun FlowsUpdatesFilter.channelCreatedEvents(): Flow<ChannelEventMessage<ChannelChatCreated>>
inline fun Flow<ChatEventMessage<*>>.channelCreatedEvents(): Flow<ChannelEventMessage<ChannelChatCreated>>
channelEvents
Link copied to clipboard
inline fun FlowsUpdatesFilter.channelEvents(): Flow<ChannelEventMessage<*>>
inline fun Flow<ChatEventMessage<*>>.channelEvents(): Flow<ChannelEventMessage<ChannelEvent>>
closePollAfter
Link copied to clipboard
fun closePollAfter(seconds: Seconds): ApproximateScheduledCloseInfo
fun closePollAfter(seconds: LongSeconds): ApproximateScheduledCloseInfo
closePollExactAfter
Link copied to clipboard
fun closePollExactAfter(seconds: Seconds): ExactScheduledCloseInfo
fun closePollExactAfter(seconds: LongSeconds): ExactScheduledCloseInfo
closePollExactAt
Link copied to clipboard
fun closePollExactAt(dateTime: DateTime): ExactScheduledCloseInfo
contactMessages
Link copied to clipboard
fun Flow<BaseSentMessageUpdate>.contactMessages(): Flow<ContentMessage<ContactContent>>
fun FlowsUpdatesFilter.contactMessages(scopeToIncludeChannels: CoroutineScope? = null): Flow<ContentMessage<ContactContent>>
createResend
Link copied to clipboard
fun SentMediaGroupUpdate.createResend(disableNotification: Boolean = false, protectContent: Boolean = false, replyTo: MessageIdentifier? = null): Request<List<MediaGroupMessage<MediaGroupContent>>>
fun List<CommonMessage<MediaGroupContent>>.createResend(chatId: ChatId, disableNotification: Boolean = false, protectContent: Boolean = false, replyTo: MessageIdentifier? = null): Request<List<MediaGroupMessage<MediaGroupContent>>>
fun List<CommonMessage<MediaGroupContent>>.createResend(chat: Chat, disableNotification: Boolean = false, protectContent: Boolean = false, replyTo: MessageIdentifier? = null): Request<List<MediaGroupMessage<MediaGroupContent>>>
deletedChannelPhotoEvents
Link copied to clipboard
inline fun Flow<ChatEventMessage<*>>.deletedChannelPhotoEvents(): Flow<ChannelEventMessage<DeleteChatPhoto>>
deletedGroupPhotoEvents
Link copied to clipboard
inline fun FlowsUpdatesFilter.deletedGroupPhotoEvents(): Flow<GroupEventMessage<DeleteChatPhoto>>
inline fun Flow<ChatEventMessage<*>>.deletedGroupPhotoEvents(): Flow<GroupEventMessage<DeleteChatPhoto>>
deletedSupergroupPhotoEvents
Link copied to clipboard
inline fun Flow<ChatEventMessage<*>>.deletedSupergroupPhotoEvents(): Flow<SupergroupEventMessage<DeleteChatPhoto>>
diceMessages
Link copied to clipboard
fun Flow<BaseSentMessageUpdate>.diceMessages(): Flow<ContentMessage<DiceContent>>
fun FlowsUpdatesFilter.diceMessages(scopeToIncludeChannels: CoroutineScope? = null): Flow<ContentMessage<DiceContent>>
documentMessages
Link copied to clipboard
fun Flow<BaseSentMessageUpdate>.documentMessages(): Flow<ContentMessage<DocumentContent>>
fun FlowsUpdatesFilter.documentMessages(scopeToIncludeChannels: CoroutineScope? = null): Flow<ContentMessage<DocumentContent>>
documentMessagesWithMediaGroups
Link copied to clipboard
fun FlowsUpdatesFilter.documentMessagesWithMediaGroups(scopeToIncludeChannels: CoroutineScope? = null): Flow<ContentMessage<DocumentContent>>
events
Link copied to clipboard
inline fun FlowsUpdatesFilter.events(): Flow<ChatEventMessage<*>>
executeAsync
Link copied to clipboard
suspend fun <T : Any> RequestsExecutor.executeAsync(request: Request<T>): Deferred<T>
fun <T : Any> RequestsExecutor.executeAsync(request: Request<T>, scope: CoroutineScope): Deferred<T>
executeUnsafe
Link copied to clipboard
suspend fun <T : Any> RequestsExecutor.executeUnsafe(request: Request<T>, retries: Int = 0, retriesDelay: Long = 1000, onAllFailed: suspend (exceptions: Array<Throwable>) -> Unit? = null): T?
filterByChatEvent
Link copied to clipboard
inline fun <T : ChatEvent, O : ChatEventMessage<T>> Flow<ChatEventMessage<*>>.filterByChatEvent(): Flow<O>
filterChannelEvents
Link copied to clipboard
inline fun <T : ChannelEvent> FlowsUpdatesFilter.filterChannelEvents(): Flow<ChannelEventMessage<T>>
inline fun <T : ChannelEvent> Flow<ChatEventMessage<*>>.filterChannelEvents(): Flow<ChannelEventMessage<T>>
filterCommandsInsideTextMessages
Link copied to clipboard
fun <T : ContentMessage<TextContent>> Flow<T>.filterCommandsInsideTextMessages(commandRegex: Regex): Flow<T>

Convert incoming dev.inmo.tgbotapi.types.message.abstracts.ContentMessage.content of messages with fullEntitiesList and check that incoming message contains BotCommandTextSource. Besides, it is checking that BotCommandTextSource.command with incoming commandRegex

filterCommandsWithArgs
Link copied to clipboard
fun <T : ContentMessage<TextContent>> Flow<T>.filterCommandsWithArgs(commandRegex: Regex): Flow<Pair<T, List<TextSource>>>

Convert incoming dev.inmo.tgbotapi.types.message.abstracts.ContentMessage.content of messages with fullEntitiesList and check that incoming message contains first TextSource as BotCommandTextSource. Besides, it is checking that BotCommandTextSource.command with incoming commandRegex and for other TextSource objects used next rules: all incoming text sources will be passed as is, RegularTextSource will be split by " " for several RegularTextSource which will contains not empty args without spaces.

filterContentMessages
Link copied to clipboard
inline fun <T : MessageContent> Flow<BaseSentMessageUpdate>.filterContentMessages(): Flow<ContentMessage<T>>
inline fun <T : MessageContent> FlowsUpdatesFilter.filterContentMessages(scopeToIncludeChannels: CoroutineScope? = null): Flow<ContentMessage<T>>
filterExactCommands
Link copied to clipboard
fun <T : ContentMessage<TextContent>> Flow<T>.filterExactCommands(commandRegex: Regex): Flow<T>

Convert incoming dev.inmo.tgbotapi.types.message.abstracts.ContentMessage.content of messages with fullEntitiesList and check that incoming message contains ONLY ONE TextSource and that is BotCommandTextSource. Besides, it is checking that BotCommandTextSource.command with incoming commandRegex

filterForContentMessage
Link copied to clipboard
inline fun <T : MessageContent> filterForContentMessage(): suspend (ContentMessage<*>) -> ContentMessage<T>?
filterGroupEvents
Link copied to clipboard
inline fun <T : GroupEvent> FlowsUpdatesFilter.filterGroupEvents(): Flow<GroupEventMessage<T>>
inline fun <T : GroupEvent> Flow<ChatEventMessage<*>>.filterGroupEvents(): Flow<GroupEventMessage<T>>
filterMediaGroupMessages
Link copied to clipboard
inline fun <T : MediaGroupContent> Flow<SentMediaGroupUpdate>.filterMediaGroupMessages(): Flow<List<CommonMessage<T>>>
inline fun <T : MediaGroupContent> FlowsUpdatesFilter.filterMediaGroupMessages(scopeToIncludeChannels: CoroutineScope? = null): Flow<List<CommonMessage<T>>>
filterPrivateEvents
Link copied to clipboard
inline fun <T : PrivateEvent> FlowsUpdatesFilter.filterPrivateEvents(): Flow<PrivateEventMessage<T>>
inline fun <T : PrivateEvent> Flow<ChatEventMessage<*>>.filterPrivateEvents(): Flow<PrivateEventMessage<T>>
filterSupergroupEvents
Link copied to clipboard
inline fun <T : SupergroupEvent> FlowsUpdatesFilter.filterSupergroupEvents(): Flow<SupergroupEventMessage<T>>
inline fun <T : SupergroupEvent> Flow<ChatEventMessage<*>>.filterSupergroupEvents(): Flow<SupergroupEventMessage<T>>
gameMessages
Link copied to clipboard
fun Flow<BaseSentMessageUpdate>.gameMessages(): Flow<ContentMessage<GameContent>>
fun FlowsUpdatesFilter.gameMessages(scopeToIncludeChannels: CoroutineScope? = null): Flow<ContentMessage<GameContent>>
groupCreatedEvents
Link copied to clipboard
inline fun FlowsUpdatesFilter.groupCreatedEvents(): Flow<GroupEventMessage<GroupChatCreated>>
inline fun Flow<ChatEventMessage<*>>.groupCreatedEvents(): Flow<GroupEventMessage<GroupChatCreated>>
groupEvents
Link copied to clipboard
inline fun FlowsUpdatesFilter.groupEvents(): Flow<GroupEventMessage<*>>
inline fun Flow<ChatEventMessage<*>>.groupEvents(): Flow<GroupEventMessage<GroupEvent>>
imageMessages
Link copied to clipboard
fun Flow<BaseSentMessageUpdate>.imageMessages(): Flow<ContentMessage<PhotoContent>>

inline fun FlowsUpdatesFilter.imageMessages(scopeToIncludeChannels: CoroutineScope? = null): Flow<ContentMessage<PhotoContent>>

Shortcut for photoMessages

imageMessagesWithMediaGroups
Link copied to clipboard
fun FlowsUpdatesFilter.imageMessagesWithMediaGroups(scopeToIncludeChannels: CoroutineScope? = null): Flow<ContentMessage<PhotoContent>>
invoiceMessages
Link copied to clipboard
fun Flow<BaseSentMessageUpdate>.invoiceMessages(): Flow<ContentMessage<InvoiceContent>>
fun FlowsUpdatesFilter.invoiceMessages(scopeToIncludeChannels: CoroutineScope? = null): Flow<ContentMessage<InvoiceContent>>
leftGroupMemberEvents
Link copied to clipboard
inline fun FlowsUpdatesFilter.leftGroupMemberEvents(): Flow<GroupEventMessage<LeftChatMember>>
inline fun Flow<ChatEventMessage<*>>.leftGroupMemberEvents(): Flow<GroupEventMessage<LeftChatMember>>
leftSupergroupMemberEvents
Link copied to clipboard
inline fun Flow<ChatEventMessage<*>>.leftSupergroupMemberEvents(): Flow<SupergroupEventMessage<LeftChatMember>>
locationMessages
Link copied to clipboard
fun Flow<BaseSentMessageUpdate>.locationMessages(): Flow<ContentMessage<LocationContent>>
fun FlowsUpdatesFilter.locationMessages(scopeToIncludeChannels: CoroutineScope? = null): Flow<ContentMessage<LocationContent>>
mediaGroupAudioMessages
Link copied to clipboard
fun Flow<SentMediaGroupUpdate>.mediaGroupAudioMessages(): Flow<List<CommonMessage<AudioContent>>>
fun FlowsUpdatesFilter.mediaGroupAudioMessages(scopeToIncludeChannels: CoroutineScope? = null): Flow<List<CommonMessage<AudioContent>>>
mediaGroupDocumentMessages
Link copied to clipboard
fun Flow<SentMediaGroupUpdate>.mediaGroupDocumentMessages(): Flow<List<CommonMessage<DocumentContent>>>
fun FlowsUpdatesFilter.mediaGroupDocumentMessages(scopeToIncludeChannels: CoroutineScope? = null): Flow<List<CommonMessage<DocumentContent>>>
mediaGroupMessages
Link copied to clipboard
fun Flow<SentMediaGroupUpdate>.mediaGroupMessages(): Flow<List<CommonMessage<MediaGroupContent>>>
fun FlowsUpdatesFilter.mediaGroupMessages(scopeToIncludeChannels: CoroutineScope? = null): Flow<List<CommonMessage<MediaGroupContent>>>
mediaGroupPhotosMessages
Link copied to clipboard
fun Flow<SentMediaGroupUpdate>.mediaGroupPhotosMessages(): Flow<List<CommonMessage<PhotoContent>>>
fun FlowsUpdatesFilter.mediaGroupPhotosMessages(scopeToIncludeChannels: CoroutineScope? = null): Flow<List<CommonMessage<PhotoContent>>>
mediaGroupVideosMessages
Link copied to clipboard
fun Flow<SentMediaGroupUpdate>.mediaGroupVideosMessages(): Flow<List<CommonMessage<VideoContent>>>
fun FlowsUpdatesFilter.mediaGroupVideosMessages(scopeToIncludeChannels: CoroutineScope? = null): Flow<List<CommonMessage<VideoContent>>>
mediaGroupVisualMessages
Link copied to clipboard
fun FlowsUpdatesFilter.mediaGroupVisualMessages(scopeToIncludeChannels: CoroutineScope? = null): Flow<List<CommonMessage<VisualMediaGroupContent>>>
newChannelPhotoEvents
Link copied to clipboard
inline fun FlowsUpdatesFilter.newChannelPhotoEvents(): Flow<ChannelEventMessage<NewChatPhoto>>
inline fun Flow<ChatEventMessage<*>>.newChannelPhotoEvents(): Flow<ChannelEventMessage<NewChatPhoto>>
newChannelPinnedMessageEvents
Link copied to clipboard
inline fun Flow<ChatEventMessage<*>>.newChannelPinnedMessageEvents(): Flow<ChannelEventMessage<PinnedMessage>>
newChannelTitleEvents
Link copied to clipboard
inline fun FlowsUpdatesFilter.newChannelTitleEvents(): Flow<ChannelEventMessage<NewChatTitle>>
inline fun Flow<ChatEventMessage<*>>.newChannelTitleEvents(): Flow<ChannelEventMessage<NewChatTitle>>
newGroupMembersEvents
Link copied to clipboard
inline fun FlowsUpdatesFilter.newGroupMembersEvents(): Flow<GroupEventMessage<NewChatMembers>>
inline fun Flow<ChatEventMessage<*>>.newGroupMembersEvents(): Flow<GroupEventMessage<NewChatMembers>>
newGroupPhotoEvents
Link copied to clipboard
inline fun FlowsUpdatesFilter.newGroupPhotoEvents(): Flow<GroupEventMessage<NewChatPhoto>>
inline fun Flow<ChatEventMessage<*>>.newGroupPhotoEvents(): Flow<GroupEventMessage<NewChatPhoto>>
newGroupPinnedMessageEvents
Link copied to clipboard
inline fun FlowsUpdatesFilter.newGroupPinnedMessageEvents(): Flow<GroupEventMessage<PinnedMessage>>
inline fun Flow<ChatEventMessage<*>>.newGroupPinnedMessageEvents(): Flow<GroupEventMessage<PinnedMessage>>
newGroupTitleEvents
Link copied to clipboard
inline fun FlowsUpdatesFilter.newGroupTitleEvents(): Flow<GroupEventMessage<NewChatTitle>>
inline fun Flow<ChatEventMessage<*>>.newGroupTitleEvents(): Flow<GroupEventMessage<NewChatTitle>>
newPrivatePinnedMessageEvents
Link copied to clipboard
inline fun Flow<ChatEventMessage<*>>.newPrivatePinnedMessageEvents(): Flow<PrivateEventMessage<PinnedMessage>>
newSupergroupMembersEvents
Link copied to clipboard
inline fun Flow<ChatEventMessage<*>>.newSupergroupMembersEvents(): Flow<SupergroupEventMessage<NewChatMembers>>
newSupergroupPhotoEvents
Link copied to clipboard
inline fun FlowsUpdatesFilter.newSupergroupPhotoEvents(): Flow<SupergroupEventMessage<NewChatPhoto>>
inline fun Flow<ChatEventMessage<*>>.newSupergroupPhotoEvents(): Flow<SupergroupEventMessage<NewChatPhoto>>
newSupergroupPinnedMessageEvents
Link copied to clipboard
newSupergroupTitleEvents
Link copied to clipboard
inline fun FlowsUpdatesFilter.newSupergroupTitleEvents(): Flow<SupergroupEventMessage<NewChatTitle>>
inline fun Flow<ChatEventMessage<*>>.newSupergroupTitleEvents(): Flow<SupergroupEventMessage<NewChatTitle>>
photoMessages
Link copied to clipboard
fun Flow<BaseSentMessageUpdate>.photoMessages(): Flow<ContentMessage<PhotoContent>>
fun FlowsUpdatesFilter.photoMessages(scopeToIncludeChannels: CoroutineScope? = null): Flow<ContentMessage<PhotoContent>>
photoMessagesWithMediaGroups
Link copied to clipboard
fun FlowsUpdatesFilter.photoMessagesWithMediaGroups(scopeToIncludeChannels: CoroutineScope? = null): Flow<ContentMessage<PhotoContent>>
pollMessages
Link copied to clipboard
fun Flow<BaseSentMessageUpdate>.pollMessages(): Flow<ContentMessage<PollContent>>
fun FlowsUpdatesFilter.pollMessages(scopeToIncludeChannels: CoroutineScope? = null): Flow<ContentMessage<PollContent>>
privateEvents
Link copied to clipboard
inline fun FlowsUpdatesFilter.privateEvents(): Flow<PrivateEventMessage<*>>
inline fun Flow<ChatEventMessage<*>>.privateEvents(): Flow<PrivateEventMessage<PrivateEvent>>
sentMessages
Link copied to clipboard
fun FlowsUpdatesFilter.sentMessages(scopeToIncludeChannels: CoroutineScope? = null): Flow<ContentMessage<MessageContent>>
sentMessagesWithMediaGroups
Link copied to clipboard
fun FlowsUpdatesFilter.sentMessagesWithMediaGroups(scopeToIncludeChannels: CoroutineScope? = null): Flow<ContentMessage<MessageContent>>
stickerMessages
Link copied to clipboard
fun Flow<BaseSentMessageUpdate>.stickerMessages(): Flow<ContentMessage<StickerContent>>
fun FlowsUpdatesFilter.stickerMessages(scopeToIncludeChannels: CoroutineScope? = null): Flow<ContentMessage<StickerContent>>
successfulPaymentInChannelEvents
Link copied to clipboard
successfulPaymentInGroupEvents
Link copied to clipboard
successfulPaymentInPrivateEvents
Link copied to clipboard
supergroupCreatedEvents
Link copied to clipboard
inline fun Flow<ChatEventMessage<*>>.supergroupCreatedEvents(): Flow<SupergroupEventMessage<SupergroupChatCreated>>
supergroupEvents
Link copied to clipboard
inline fun FlowsUpdatesFilter.supergroupEvents(): Flow<SupergroupEventMessage<*>>
inline fun Flow<ChatEventMessage<*>>.supergroupEvents(): Flow<SupergroupEventMessage<SupergroupEvent>>
textMessages
Link copied to clipboard
fun Flow<BaseSentMessageUpdate>.textMessages(): Flow<ContentMessage<TextContent>>
fun FlowsUpdatesFilter.textMessages(scopeToIncludeChannels: CoroutineScope? = null): Flow<ContentMessage<TextContent>>
venueMessages
Link copied to clipboard
fun Flow<BaseSentMessageUpdate>.venueMessages(): Flow<ContentMessage<VenueContent>>
fun FlowsUpdatesFilter.venueMessages(scopeToIncludeChannels: CoroutineScope? = null): Flow<ContentMessage<VenueContent>>
videoMessages
Link copied to clipboard
fun Flow<BaseSentMessageUpdate>.videoMessages(): Flow<ContentMessage<VideoContent>>
fun FlowsUpdatesFilter.videoMessages(scopeToIncludeChannels: CoroutineScope? = null): Flow<ContentMessage<VideoContent>>
videoMessagesWithMediaGroups
Link copied to clipboard
fun FlowsUpdatesFilter.videoMessagesWithMediaGroups(scopeToIncludeChannels: CoroutineScope? = null): Flow<ContentMessage<VideoContent>>
videoNoteMessages
Link copied to clipboard
fun Flow<BaseSentMessageUpdate>.videoNoteMessages(): Flow<ContentMessage<VideoNoteContent>>
fun FlowsUpdatesFilter.videoNoteMessages(scopeToIncludeChannels: CoroutineScope? = null): Flow<ContentMessage<VideoNoteContent>>
voiceMessages
Link copied to clipboard
fun Flow<BaseSentMessageUpdate>.voiceMessages(): Flow<ContentMessage<VoiceContent>>
fun FlowsUpdatesFilter.voiceMessages(scopeToIncludeChannels: CoroutineScope? = null): Flow<ContentMessage<VoiceContent>>

Properties

chat
Link copied to clipboard
val List<CommonMessage<out MediaGroupContent>>.chat: Chat?
chat
Link copied to clipboard
val SentMediaGroupUpdate.chat: Chat
forwardInfo
Link copied to clipboard
val List<CommonMessage<out MediaGroupContent>>.forwardInfo: ForwardInfo?
forwardInfo
Link copied to clipboard
val SentMediaGroupUpdate.forwardInfo: ForwardInfo?
mediaGroupId
Link copied to clipboard
val List<MediaGroupMessage<*>>.mediaGroupId: MediaGroupIdentifier?
mediaGroupId
Link copied to clipboard
replyTo
Link copied to clipboard
val List<CommonMessage<out MediaGroupContent>>.replyTo: Message?
replyTo
Link copied to clipboard
val SentMediaGroupUpdate.replyTo: Message?