Package-level declarations
Types
Link copied to clipboard
object TelegramBotCommandsDefaults
Functions
Link copied to clipboard
suspend fun PathedFile.download(telegramAPIUrlsKeeper: TelegramAPIUrlsKeeper, client: HttpClient = HttpClient()): ByteArray
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: String): Map<String, Array<String>>
fun ContentMessage<TextContent>.parseCommandsWithArgs(argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex): Map<String, Array<String>>
fun List<TextSource>.parseCommandsWithArgs(argsSeparator: String): MutableMap<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
fun TextedWithTextSources.parseCommandsWithArgsSources(): Map<BotCommandTextSource, Array<TextSource>>
fun ContentMessage<TextContent>.parseCommandsWithArgsSources(): Map<BotCommandTextSource, Array<TextSource>>
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
Link copied to clipboard
inline fun Message.sameThread(chatId: ChatIdentifier, threadId: MessageThreadId? = chatId.threadId): Boolean
Thread is the same thing that topic
Link copied to clipboard
inline fun Message.sameTopic(chatId: ChatIdentifier, threadId: MessageThreadId? = chatId.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 }, commonChatMemberUpdatedUpdateConverter: (CommonChatMemberUpdatedUpdate) -> Chat? = { it.data.chat }): Chat?
Link copied to clipboard