From 5aa5460a4393b7f22428c87f4dca865300572565 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 16 Sep 2022 16:36:21 +0600 Subject: [PATCH] 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)