commonMain.dev.inmo.tgbotapi.extensions.api.edit.media.EditChatMessageMedia.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tgbotapi.api-jvm Show documentation
Show all versions of tgbotapi.api-jvm Show documentation
API extensions with "Telegram Bot API"-like extensions for TelegramBot and RequestsExecutor
package dev.inmo.tgbotapi.extensions.api.edit.media
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.edit.media.EditChatMessageMedia
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.media.TelegramFreeMedia
import dev.inmo.tgbotapi.types.MessageId
import dev.inmo.tgbotapi.types.businessConnectionId
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.content.MediaContent
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
public suspend fun TelegramBot.editMessageMedia(
chatId: ChatIdentifier,
messageId: MessageId,
media: TelegramFreeMedia,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null
): ContentMessage = execute(
EditChatMessageMedia(chatId, messageId, media, businessConnectionId, replyMarkup)
)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
public suspend fun TelegramBot.editMessageMedia(
chat: Chat,
messageId: MessageId,
media: TelegramFreeMedia,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null
): ContentMessage = editMessageMedia(chat.id, messageId, media, businessConnectionId, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
public suspend fun TelegramBot.editMessageMedia(
message: ContentMessage,
media: TelegramFreeMedia,
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null
): ContentMessage = editMessageMedia(message.chat.id, message.messageId, media, businessConnectionId, replyMarkup)