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

Functions

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

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

common
fun <T : ContentMessage<TextContent>> Flow<T>.filterCommandsInsideTextMessages(commandRegex: Regex): Flow<T>
filterCommandsWithArgs
Link copied to clipboard

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.

common
fun <T : ContentMessage<TextContent>> Flow<T>.filterCommandsWithArgs(commandRegex: Regex): Flow<Pair<T, List<TextSource>>>
filterContentMessages
Link copied to clipboard
common
inline fun <T : MessageContent> Flow<BaseSentMessageUpdate>.filterContentMessages(): Flow<ContentMessage<T>>
inline fun <T : MessageContent> FlowsUpdatesFilter.filterContentMessages(scopeToIncludeChannels: CoroutineScope?): Flow<ContentMessage<T>>
filterExactCommands
Link copied to clipboard

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

common
fun <T : ContentMessage<TextContent>> Flow<T>.filterExactCommands(commandRegex: Regex): Flow<T>
filterForContentMessage
Link copied to clipboard
common
inline fun <T : MessageContent> filterForContentMessage(): SuspendFunction1<ContentMessage<*>, ContentMessage<T>?>
filterGroupEvents
Link copied to clipboard
common
inline fun <T : GroupEvent> FlowsUpdatesFilter.filterGroupEvents(): Flow<GroupEventMessage<T>>
inline fun <T : GroupEvent> Flow<ChatEventMessage<*>>.filterGroupEvents(): Flow<GroupEventMessage<T>>
filterMediaGroupMessages
Link copied to clipboard
common
inline fun <T : MediaGroupContent> Flow<SentMediaGroupUpdate>.filterMediaGroupMessages(): Flow<List<CommonMessage<T>>>
inline fun <T : MediaGroupContent> FlowsUpdatesFilter.filterMediaGroupMessages(scopeToIncludeChannels: CoroutineScope?): Flow<List<CommonMessage<T>>>
filterSupergroupEvents
Link copied to clipboard
common
inline fun <T : SupergroupEvent> FlowsUpdatesFilter.filterSupergroupEvents(): Flow<SupergroupEventMessage<T>>
inline fun <T : SupergroupEvent> Flow<ChatEventMessage<*>>.filterSupergroupEvents(): Flow<SupergroupEventMessage<T>>
gameMessages
Link copied to clipboard
common
fun Flow<BaseSentMessageUpdate>.gameMessages(): Flow<ContentMessage<GameContent>>
fun FlowsUpdatesFilter.gameMessages(scopeToIncludeChannels: CoroutineScope?): Flow<ContentMessage<GameContent>>
groupCreatedEvents
Link copied to clipboard
common
inline fun FlowsUpdatesFilter.groupCreatedEvents(): Flow<GroupEventMessage<GroupChatCreated>>
inline fun Flow<ChatEventMessage<*>>.groupCreatedEvents(): Flow<GroupEventMessage<GroupChatCreated>>
groupEvents
Link copied to clipboard
common
inline fun FlowsUpdatesFilter.groupEvents(): Flow<GroupEventMessage<*>>
inline fun Flow<ChatEventMessage<*>>.groupEvents(): Flow<GroupEventMessage<GroupEvent>>
imageMessages
Link copied to clipboard
common
fun Flow<BaseSentMessageUpdate>.imageMessages(): Flow<ContentMessage<PhotoContent>>

Shortcut for photoMessages

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

Properties

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