Package dev.inmo.tgbotapi.extensions.utils

Types

SlotMachineReelImages
Link copied to clipboard
common
enum SlotMachineReelImages : Enum<SlotMachineReelImages>
SlotMachineResult
Link copied to clipboard
common
data class SlotMachineResult(rawValue: Int)

Functions

aggregateFlows
Link copied to clipboard

Analog of merge function for Flows. The difference is in the usage of BroadcastChannel in this case

common
fun <T> aggregateFlows(withScope: CoroutineScope, vararg flows: Array<Out Flow<T>>, internalBufferSize: Int): Flow<T>
calculateSlotMachineResult
Link copied to clipboard
common
fun Dice.calculateSlotMachineResult(): SlotMachineResult?
commonMessages
Link copied to clipboard

Shortcut for onlyCommonMessages

common
inline fun <C : MessageContent, T : ContentMessage<C>> Flow<T>.commonMessages(): Flow<CommonMessage<C>>
flatMap
Link copied to clipboard
common
fun <T> Flow<Iterable<T>>.flatMap(): Flow<T>
fun <T, R> Flow<T>.flatMap(mapper: (T) -> Iterable<R>): Flow<R>
onlyAnimationContentMessages
Link copied to clipboard
common
fun Flow<ContentMessage<*>>.onlyAnimationContentMessages(): Flow<ContentMessage<AnimationContent>>
onlyAudioContentMessages
Link copied to clipboard
common
fun Flow<ContentMessage<*>>.onlyAudioContentMessages(): Flow<ContentMessage<AudioContent>>
onlyCommonMessages
Link copied to clipboard

Simple factory to convert ContentMessage to a CommonMessage

common
fun <C : MessageContent, T : ContentMessage<C>> Flow<T>.onlyCommonMessages(): Flow<CommonMessage<C>>
onlyContactContentMessages
Link copied to clipboard
common
fun Flow<ContentMessage<*>>.onlyContactContentMessages(): Flow<ContentMessage<ContactContent>>
onlyDiceContentMessages
Link copied to clipboard
common
fun Flow<ContentMessage<*>>.onlyDiceContentMessages(): Flow<ContentMessage<DiceContent>>
onlyDocumentContentMessages
Link copied to clipboard
common
fun Flow<ContentMessage<*>>.onlyDocumentContentMessages(): Flow<ContentMessage<DocumentContent>>
onlyGameContentMessages
Link copied to clipboard
common
fun Flow<ContentMessage<*>>.onlyGameContentMessages(): Flow<ContentMessage<GameContent>>
onlyInlineMessageIdDataCallbackQueries
Link copied to clipboard
common
onlyInvoiceContentMessages
Link copied to clipboard
common
fun Flow<ContentMessage<*>>.onlyInvoiceContentMessages(): Flow<ContentMessage<InvoiceContent>>
onlyLocationContentMessages
Link copied to clipboard
common
fun Flow<ContentMessage<*>>.onlyLocationContentMessages(): Flow<ContentMessage<LocationContent>>
onlyMessageDataCallbackQueries
Link copied to clipboard
common
fun <T : CallbackQuery> Flow<T>.onlyMessageDataCallbackQueries(): Flow<MessageDataCallbackQuery>
onlyPhotoContentMessages
Link copied to clipboard
common
fun Flow<ContentMessage<*>>.onlyPhotoContentMessages(): Flow<ContentMessage<PhotoContent>>
onlyPollContentMessages
Link copied to clipboard
common
fun Flow<ContentMessage<*>>.onlyPollContentMessages(): Flow<ContentMessage<PollContent>>
onlySentViaBot
Link copied to clipboard

Filter the messages and checking that incoming CommonMessage is PossiblySentViaBotCommonMessage and its PossiblySentViaBotCommonMessage.senderBot is not null

common
fun <MC : MessageContent, M : ContentMessage<MC>> Flow<M>.onlySentViaBot(): Flow<Any>
onlyStickerContentMessages
Link copied to clipboard
common
fun Flow<ContentMessage<*>>.onlyStickerContentMessages(): Flow<ContentMessage<StickerContent>>
onlyTextContentMessages
Link copied to clipboard
common
fun Flow<ContentMessage<*>>.onlyTextContentMessages(): Flow<ContentMessage<TextContent>>
onlyVenueContentMessages
Link copied to clipboard
common
fun Flow<ContentMessage<*>>.onlyVenueContentMessages(): Flow<ContentMessage<VenueContent>>
onlyVideoContentMessages
Link copied to clipboard
common
fun Flow<ContentMessage<*>>.onlyVideoContentMessages(): Flow<ContentMessage<VideoContent>>
onlyVideoNoteContentMessages
Link copied to clipboard
common
fun Flow<ContentMessage<*>>.onlyVideoNoteContentMessages(): Flow<ContentMessage<VideoNoteContent>>
onlyVoiceContentMessages
Link copied to clipboard
common
fun Flow<ContentMessage<*>>.onlyVoiceContentMessages(): Flow<ContentMessage<VoiceContent>>
withContentType
Link copied to clipboard
common
fun <T : MessageContent> Flow<ContentMessage<*>>.withContentType(contentType: KClass<T>): Flow<ContentMessage<T>>
withoutSentViaBot
Link copied to clipboard

Filter the messages and checking that incoming CommonMessage not is PossiblySentViaBotCommonMessage or its PossiblySentViaBotCommonMessage.senderBot is null

common
fun <MC : MessageContent, M : ContentMessage<MC>> Flow<M>.withoutSentViaBot(): Flow<M>

Properties

asSlotMachineReelImage
Link copied to clipboard
val Int.asSlotMachineReelImage: SlotMachineReelImages