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

Functions

Link copied to clipboard
fun Flow<BaseSentMessageUpdate>.animationMessages(): Flow<ContentMessage<AnimationContent>>
fun FlowsUpdatesFilter.animationMessages(scopeToIncludeChannels: CoroutineScope? = null): Flow<ContentMessage<AnimationContent>>
Link copied to clipboard
fun Flow<BaseSentMessageUpdate>.audioMessages(): Flow<ContentMessage<AudioContent>>
fun FlowsUpdatesFilter.audioMessages(scopeToIncludeChannels: CoroutineScope? = null): Flow<ContentMessage<AudioContent>>
Link copied to clipboard
fun FlowsUpdatesFilter.audioMessagesWithMediaGroups(scopeToIncludeChannels: CoroutineScope? = null): Flow<ContentMessage<AudioContent>>
Link copied to clipboard
inline fun FlowsUpdatesFilter.channelCreatedEvents(): Flow<ChannelEventMessage<ChannelChatCreated>>
inline fun Flow<ChatEventMessage<*>>.channelCreatedEvents(): Flow<ChannelEventMessage<ChannelChatCreated>>
Link copied to clipboard
inline fun FlowsUpdatesFilter.channelEvents(): Flow<ChannelEventMessage<*>>
inline fun Flow<ChatEventMessage<*>>.channelEvents(): Flow<ChannelEventMessage<ChannelEvent>>
Link copied to clipboard
fun closePollAfter(seconds: Seconds): ApproximateScheduledCloseInfo
fun closePollAfter(seconds: LongSeconds): ApproximateScheduledCloseInfo
Link copied to clipboard
fun closePollExactAfter(seconds: Seconds): ExactScheduledCloseInfo
fun closePollExactAfter(seconds: LongSeconds): ExactScheduledCloseInfo
Link copied to clipboard
fun closePollExactAt(dateTime: DateTime): ExactScheduledCloseInfo
Link copied to clipboard
fun Flow<BaseSentMessageUpdate>.contactMessages(): Flow<ContentMessage<ContactContent>>
fun FlowsUpdatesFilter.contactMessages(scopeToIncludeChannels: CoroutineScope? = null): Flow<ContentMessage<ContactContent>>
Link copied to clipboard
fun SentMediaGroupUpdate.createResend(    disableNotification: Boolean = false,     protectContent: Boolean = false,     replyTo: MessageId? = null): Request<List<MediaGroupMessage<MediaGroupContent>>>
fun List<CommonMessage<MediaGroupContent>>.createResend(    chatId: ChatId,     disableNotification: Boolean = false,     protectContent: Boolean = false,     replyTo: MessageId? = null): Request<List<MediaGroupMessage<MediaGroupContent>>>
fun List<CommonMessage<MediaGroupContent>>.createResend(    chat: Chat,     disableNotification: Boolean = false,     protectContent: Boolean = false,     replyTo: MessageId? = null): Request<List<MediaGroupMessage<MediaGroupContent>>>
Link copied to clipboard
inline fun Flow<ChatEventMessage<*>>.deletedChannelPhotoEvents(): Flow<ChannelEventMessage<DeleteChatPhoto>>
Link copied to clipboard
inline fun FlowsUpdatesFilter.deletedGroupPhotoEvents(): Flow<GroupEventMessage<DeleteChatPhoto>>
inline fun Flow<ChatEventMessage<*>>.deletedGroupPhotoEvents(): Flow<GroupEventMessage<DeleteChatPhoto>>
Link copied to clipboard
inline fun Flow<ChatEventMessage<*>>.deletedSupergroupPhotoEvents(): Flow<SupergroupEventMessage<DeleteChatPhoto>>
Link copied to clipboard
fun Flow<BaseSentMessageUpdate>.diceMessages(): Flow<ContentMessage<DiceContent>>
fun FlowsUpdatesFilter.diceMessages(scopeToIncludeChannels: CoroutineScope? = null): Flow<ContentMessage<DiceContent>>
Link copied to clipboard
fun Flow<BaseSentMessageUpdate>.documentMessages(): Flow<ContentMessage<DocumentContent>>
fun FlowsUpdatesFilter.documentMessages(scopeToIncludeChannels: CoroutineScope? = null): Flow<ContentMessage<DocumentContent>>
Link copied to clipboard
fun FlowsUpdatesFilter.documentMessagesWithMediaGroups(scopeToIncludeChannels: CoroutineScope? = null): Flow<ContentMessage<DocumentContent>>
Link copied to clipboard
inline fun FlowsUpdatesFilter.events(): Flow<ChatEventMessage<*>>
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>
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?
Link copied to clipboard
inline fun <T : ChatEvent, O : ChatEventMessage<T>> Flow<ChatEventMessage<*>>.filterByChatEvent(): Flow<O>
Link copied to clipboard
inline fun <T : ChannelEvent> FlowsUpdatesFilter.filterChannelEvents(): Flow<ChannelEventMessage<T>>
inline fun <T : ChannelEvent> Flow<ChatEventMessage<*>>.filterChannelEvents(): Flow<ChannelEventMessage<T>>
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

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.

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>>
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

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

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

Shortcut for photoMessages

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

Properties

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