Package-level declarations

Types

Properties

Link copied to clipboard

Member became a chat owner

Link copied to clipboard

Member ceased their chat ownership

Link copied to clipboard

Member was demoted from administrators (or ceased chat ownership)

Link copied to clipboard

Member was promoted to chat administrator (or owner)

Link copied to clipboard

Member was promoted to chat administrator (or owner) or got it permissions/title changed

Link copied to clipboard

Member was restricted or some restrictions have changed

Link copied to clipboard

Member restrictions were changed (but not removed)

Link copied to clipboard

All member restrictions were removed

Link copied to clipboard
Link copied to clipboard

Check that member is KickedChatMember

Link copied to clipboard
Link copied to clipboard

Check if receiver object is MemberChatMemberImpl

Link copied to clipboard

Check if receiver object is KickedChatMember

Link copied to clipboard
Link copied to clipboard

Check if receiver object is LeftChatMember

Link copied to clipboard

Check if receiver object isLeft or isKicked

Link copied to clipboard

Check if receiver object is MemberChatMember

Link copied to clipboard

Check if receiver object is OwnerChatMember

Link copied to clipboard

Check if receiver object is RestrictedChatMember

Link copied to clipboard

Check if receiver object isRestricted and not isKicked

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

User joined a chat

Link copied to clipboard

Member left a chat for any reason

Link copied to clipboard

Member became a chat subscriber

Link copied to clipboard

Member became a chat subscriber or renewed their subscription

Link copied to clipboard

Member subscription was expired. User still can be a member

Link copied to clipboard

Member subscription was expired and user left the chat

Functions

Link copied to clipboard
suspend fun PathedFile.download(telegramAPIUrlsKeeper: TelegramAPIUrlsKeeper, client: HttpClient = HttpClient()): ByteArray
Link copied to clipboard
inline fun <T : WithPreviewChat> Flow<T>.fromChat(chatId: ChatIdentifier): Flow<T>

Will pass only those T which have sameChat as chatId

inline fun <T : WithPreviewChat> Flow<T>.fromChat(chat: Chat): Flow<T>

Will pass only those T which have sameChat as chatId

Link copied to clipboard
inline fun <T : FromUser> Flow<T>.fromUser(userId: UserId): Flow<T>
inline fun <T : FromUser> Flow<T>.fromUser(user: User): Flow<T>
Link copied to clipboard
suspend fun HttpClient.loadFile(telegramAPIUrlsKeeper: TelegramAPIUrlsKeeper, pathedFile: PathedFile): ByteArray
suspend fun HttpClient.loadFile(telegramAPIUrlsKeeper: TelegramAPIUrlsKeeper, filePath: String): ByteArray
Link copied to clipboard
fun TextedWithTextSources.parseCommandsWithArgs(argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex): Map<String, Array<String>>
fun ContentMessage<TextContent>.parseCommandsWithArgs(argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex): Map<String, Array<String>>
fun List<TextSource>.parseCommandsWithArgs(argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex): MutableMap<String, Array<String>>

Parse commands and their args. Logic will find command, get all subsequent data as args until new command

Link copied to clipboard

Parse text sources to find commands with their arguments. This method will skip all the text sources before first command and all following text sources until the next command will be guessed as an args of last found command

Link copied to clipboard
fun TextedWithTextSources.parseCommandsWithNamedArgs(argsSeparator: String, nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex): Map<String, List<Pair<String, String>>>
fun TextedWithTextSources.parseCommandsWithNamedArgs(argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex): Map<String, List<Pair<String, String>>>
fun ContentMessage<TextContent>.parseCommandsWithNamedArgs(argsSeparator: String, nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex): Map<String, List<Pair<String, String>>>
fun ContentMessage<TextContent>.parseCommandsWithNamedArgs(argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex): Map<String, List<Pair<String, String>>>
fun List<TextSource>.parseCommandsWithNamedArgs(argsSeparator: String, nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex): Map<String, List<Pair<String, String>>>
fun List<TextSource>.parseCommandsWithNamedArgs(argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex): Map<String, List<Pair<String, String>>>

Uses parseCommandsWithArgs to create base argsSeparator split args for commands and map their as k-v pairs. Sample:

Link copied to clipboard
Link copied to clipboard
inline fun Message.sameMessage(other: Message): Boolean
inline fun Message.sameMessage(chatId: ChatIdentifier, messageId: MessageId): Boolean
inline fun Message.sameMessage(chat: Chat, messageId: MessageId): Boolean
Link copied to clipboard
inline fun Message.sameThread(other: Message): Boolean
inline fun Message.sameThread(chatId: ChatIdentifier, threadId: MessageThreadId? = chatId.threadId): Boolean
inline fun Message.sameThread(chat: Chat, threadId: MessageThreadId? = chat.id.threadId): Boolean

Thread is the same thing that topic

Link copied to clipboard
inline fun Message.sameTopic(other: Message): Boolean
inline fun Message.sameTopic(chatId: ChatIdentifier, threadId: MessageThreadId? = chatId.threadId): Boolean
inline fun Message.sameTopic(chat: Chat, threadId: MessageThreadId? = chat.id.threadId): Boolean

Thread is the same thing that topic

Link copied to clipboard
Link copied to clipboard
fun Update.sourceChatWithConverters(baseMessageUpdateConverter: (BaseMessageUpdate) -> Chat? = { it.data.chat }, chatJoinRequestUpdateConverter: (ChatJoinRequestUpdate) -> Chat? = { it.data.chat }, shippingQueryUpdateConverter: (ShippingQueryUpdate) -> Chat? = { null }, pollAnswerUpdateConverter: (PollAnswerUpdate) -> Chat? = { null }, preCheckoutQueryUpdateConverter: (PreCheckoutQueryUpdate) -> Chat? = { it.data.from }, callbackQueryUpdateConverter: (CallbackQueryUpdate) -> Chat? = { it.data.sourceChat() }, chosenInlineResultUpdateConverter: (ChosenInlineResultUpdate) -> Chat? = { null }, inlineQueryUpdateConverter: (InlineQueryUpdate) -> Chat? = { null }, pollUpdateConverter: (PollUpdate) -> Chat? = { null }, channelPostUpdateConverter: (ChannelPostUpdate) -> Chat? = { it.data.chat }, messageUpdateConverter: (MessageUpdate) -> Chat? = { it.data.chat }, editChannelPostUpdateConverter: (EditChannelPostUpdate) -> Chat? = { it.data.chat }, editMessageUpdateConverter: (EditMessageUpdate) -> Chat? = { it.data.chat }, myChatMemberUpdatedUpdateConverter: (MyChatMemberUpdatedUpdate) -> Chat? = { it.data.chat }, chatMessageReactionUpdatedUpdateConverter: (ChatMessageReactionUpdatedUpdate) -> Chat? = { it.data.chat }, chatMessageReactionsCountUpdatedUpdateConverter: (ChatMessageReactionsCountUpdatedUpdate) -> Chat? = { it.data.chat }, chatBoostUpdatedUpdateFlow: (ChatBoostUpdatedUpdate) -> Chat? = { it.data.chat }, chatBoostRemovedUpdateFlow: (ChatBoostRemovedUpdate) -> Chat? = { it.data.chat }, businessConnectionUpdateConverter: (BusinessConnectionUpdate) -> Chat? = { it.data.user }, businessMessageUpdateConverter: (BusinessMessageUpdate) -> Chat? = { it.data.chat }, editBusinessMessageUpdateConverter: (EditBusinessMessageUpdate) -> Chat? = { it.data.chat }, deleteBusinessMessageUpdateConverter: (DeletedBusinessMessageUpdate) -> Chat? = { it.data.chat }, paidMediaPurchasedUpdatesFlowConverter: (PaidMediaPurchasedUpdate) -> Chat? = { it.data.user }, commonChatMemberUpdatedUpdateConverter: (CommonChatMemberUpdatedUpdate) -> Chat? = { it.data.chat }): Chat?
Link copied to clipboard