From e937845fc7a687c93aaeaf0c211af123e2a310fc Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 16 Sep 2022 15:43:40 +0600 Subject: [PATCH 1/2] start 3.2.4 --- CHANGELOG.md | 2 ++ gradle.properties | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1b950c92e..1ccf471053 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # TelegramBotAPI changelog +## 3.2.4 + ## 3.2.3 * `Core`: diff --git a/gradle.properties b/gradle.properties index 83e700386c..bb3496928c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,4 +6,4 @@ kotlin.incremental=true kotlin.incremental.js=true library_group=dev.inmo -library_version=3.2.3 +library_version=3.2.4 From 5aa5460a4393b7f22428c87f4dca865300572565 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 16 Sep 2022 16:36:21 +0600 Subject: [PATCH 2/2] new edits --- CHANGELOG.md | 3 ++ .../tgbotapi/extensions/api/edit/Edits.kt | 29 +++++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ccf471053..46dc7feca4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## 3.2.4 +* `API`: + * New `edit`'s with chats and message ids + ## 3.2.3 * `Core`: diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/Edits.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/Edits.kt index ee6b755ff2..0464869a11 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/Edits.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/Edits.kt @@ -183,6 +183,31 @@ suspend fun TelegramBot.edit( replyMarkup: InlineKeyboardMarkup? = null ) = editMessageReplyMarkup(message, replyMarkup) +/** + * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] + * as a builder for that + */ +suspend fun TelegramBot.edit( + chatId: ChatIdentifier, + messageId: MessageId, + text: String, + parseMode: ParseMode? = null, + disableWebPagePreview: Boolean? = null, + replyMarkup: InlineKeyboardMarkup? = null +) = editMessageText(chatId, messageId, text, parseMode, disableWebPagePreview, replyMarkup) + +/** + * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] + * as a builder for that + */ +suspend fun TelegramBot.edit( + chatId: ChatIdentifier, + messageId: MessageId, + entities: TextSourcesList, + disableWebPagePreview: Boolean? = null, + replyMarkup: InlineKeyboardMarkup? = null +) = editMessageText(chatId, messageId, entities, disableWebPagePreview, replyMarkup) + /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that @@ -193,7 +218,7 @@ suspend fun TelegramBot.edit( parseMode: ParseMode? = null, disableWebPagePreview: Boolean? = null, replyMarkup: InlineKeyboardMarkup? = null -) = editMessageText(message, text, parseMode, disableWebPagePreview, replyMarkup) +) = edit(message.chat.id, message.messageId, text, parseMode, disableWebPagePreview, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] @@ -204,4 +229,4 @@ suspend fun TelegramBot.edit( entities: TextSourcesList, disableWebPagePreview: Boolean? = null, replyMarkup: InlineKeyboardMarkup? = null -) = editMessageText(message, entities, disableWebPagePreview, replyMarkup) +) = edit(message.chat.id, message.messageId, entities, disableWebPagePreview, replyMarkup)