2023-04-21 18:18:18 +00:00
|
|
|
package dev.inmo.tgbotapi.extensions.api.edit
|
|
|
|
|
|
|
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
|
|
|
import dev.inmo.tgbotapi.extensions.api.edit.location.live.editLiveLocation
|
|
|
|
import dev.inmo.tgbotapi.extensions.api.edit.media.editMessageMedia
|
|
|
|
import dev.inmo.tgbotapi.extensions.api.edit.reply_markup.editMessageReplyMarkup
|
|
|
|
import dev.inmo.tgbotapi.extensions.api.edit.text.editMessageText
|
|
|
|
import dev.inmo.tgbotapi.types.*
|
|
|
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
|
|
|
import dev.inmo.tgbotapi.types.location.LiveLocation
|
|
|
|
import dev.inmo.tgbotapi.types.media.TelegramMedia
|
|
|
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
|
|
|
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
|
|
|
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
|
|
|
import dev.inmo.tgbotapi.utils.EntitiesBuilderBody
|
|
|
|
import dev.inmo.tgbotapi.utils.buildEntities
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
|
|
|
* as a builder for that
|
|
|
|
*/
|
|
|
|
suspend fun TelegramBot.edit(
|
2024-03-16 14:36:48 +00:00
|
|
|
messageId: InlineMessageId,
|
2023-04-21 18:18:18 +00:00
|
|
|
latitude: Double,
|
|
|
|
longitude: Double,
|
|
|
|
horizontalAccuracy: Meters? = null,
|
|
|
|
heading: Degrees? = null,
|
|
|
|
proximityAlertRadius: Meters? = null,
|
|
|
|
replyMarkup: InlineKeyboardMarkup? = null
|
|
|
|
) = editLiveLocation(messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
|
|
|
* as a builder for that
|
|
|
|
*/
|
|
|
|
suspend fun TelegramBot.edit(
|
2024-03-16 14:36:48 +00:00
|
|
|
messageId: InlineMessageId,
|
2023-04-21 18:18:18 +00:00
|
|
|
location: LiveLocation,
|
|
|
|
replyMarkup: InlineKeyboardMarkup? = null
|
|
|
|
) = editLiveLocation(
|
|
|
|
messageId, location, replyMarkup
|
|
|
|
)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
|
|
|
* as a builder for that
|
|
|
|
*/
|
|
|
|
suspend fun TelegramBot.edit(
|
2024-03-16 14:36:48 +00:00
|
|
|
messageId: InlineMessageId,
|
2023-04-21 18:18:18 +00:00
|
|
|
media: TelegramMedia,
|
|
|
|
replyMarkup: InlineKeyboardMarkup? = null
|
|
|
|
) = editMessageMedia(messageId, media, replyMarkup)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
|
|
|
* as a builder for that
|
|
|
|
*/
|
|
|
|
suspend fun TelegramBot.edit(
|
2024-03-16 14:36:48 +00:00
|
|
|
messageId: InlineMessageId,
|
2023-04-21 18:18:18 +00:00
|
|
|
replyMarkup: InlineKeyboardMarkup? = null
|
|
|
|
) = editMessageReplyMarkup(messageId, replyMarkup)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
|
|
|
* as a builder for that
|
|
|
|
*/
|
|
|
|
suspend fun TelegramBot.edit(
|
2024-03-16 14:36:48 +00:00
|
|
|
messageId: InlineMessageId,
|
2023-04-21 18:18:18 +00:00
|
|
|
text: String,
|
|
|
|
parseMode: ParseMode? = null,
|
2024-01-02 16:22:47 +00:00
|
|
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
2023-04-21 18:18:18 +00:00
|
|
|
replyMarkup: InlineKeyboardMarkup? = null
|
2024-01-02 16:22:47 +00:00
|
|
|
) = editMessageText(messageId, text, parseMode, linkPreviewOptions, replyMarkup)
|
2023-04-21 18:18:18 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
|
|
|
* as a builder for that
|
|
|
|
*/
|
|
|
|
suspend fun TelegramBot.edit(
|
2024-03-16 14:36:48 +00:00
|
|
|
messageId: InlineMessageId,
|
2023-04-21 18:18:18 +00:00
|
|
|
entities: TextSourcesList,
|
2024-01-02 16:22:47 +00:00
|
|
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
2023-04-21 18:18:18 +00:00
|
|
|
replyMarkup: InlineKeyboardMarkup? = null
|
2024-01-02 16:22:47 +00:00
|
|
|
) = editMessageText(messageId, entities, linkPreviewOptions, replyMarkup)
|
2023-04-21 18:18:18 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
|
|
|
* as a builder for that
|
|
|
|
*/
|
|
|
|
suspend fun TelegramBot.edit(
|
2024-03-16 14:36:48 +00:00
|
|
|
messageId: InlineMessageId,
|
2023-04-21 18:18:18 +00:00
|
|
|
separator: TextSource? = null,
|
2024-01-02 16:22:47 +00:00
|
|
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
2023-04-21 18:18:18 +00:00
|
|
|
replyMarkup: InlineKeyboardMarkup? = null,
|
|
|
|
builderBody: EntitiesBuilderBody
|
2024-01-02 16:22:47 +00:00
|
|
|
) = edit(messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
2023-04-21 18:18:18 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
|
|
|
* as a builder for that
|
|
|
|
*/
|
|
|
|
suspend fun TelegramBot.edit(
|
2024-03-16 14:36:48 +00:00
|
|
|
messageId: InlineMessageId,
|
2023-04-21 18:18:18 +00:00
|
|
|
separator: String,
|
2024-01-02 16:22:47 +00:00
|
|
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
2023-04-21 18:18:18 +00:00
|
|
|
replyMarkup: InlineKeyboardMarkup? = null,
|
|
|
|
builderBody: EntitiesBuilderBody
|
2024-01-02 16:22:47 +00:00
|
|
|
) = edit(messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|