tgbotapi/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/LiveLocation/EditChatMessageLiveLocation.kt

95 lines
3.7 KiB
Kotlin
Raw Normal View History

package dev.inmo.tgbotapi.extensions.api.edit.LiveLocation
2020-02-15 09:33:04 +00:00
2020-10-04 11:06:30 +00:00
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.edit.LiveLocation.EditChatMessageLiveLocation
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
2020-11-05 17:48:23 +00:00
import dev.inmo.tgbotapi.types.location.LiveLocation
2020-10-04 11:06:30 +00:00
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.content.LocationContent
2020-02-15 09:33:04 +00:00
2021-10-01 13:38:22 +00:00
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.editLiveLocation(
2020-02-15 09:33:04 +00:00
chatId: ChatIdentifier,
messageId: MessageIdentifier,
latitude: Double,
longitude: Double,
2020-11-05 17:48:23 +00:00
horizontalAccuracy: Meters? = null,
heading: Degrees? = null,
proximityAlertRadius: Meters? = null,
2020-02-15 09:33:04 +00:00
replyMarkup: InlineKeyboardMarkup? = null
) = execute(
EditChatMessageLiveLocation(
2020-11-05 17:48:23 +00:00
chatId, messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup
2020-02-15 09:33:04 +00:00
)
)
2021-10-01 13:38:22 +00:00
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.editLiveLocation(
2020-02-15 09:33:04 +00:00
chat: Chat,
messageId: MessageIdentifier,
latitude: Double,
longitude: Double,
2020-11-05 17:48:23 +00:00
horizontalAccuracy: Meters? = null,
heading: Degrees? = null,
proximityAlertRadius: Meters? = null,
2020-02-15 09:33:04 +00:00
replyMarkup: InlineKeyboardMarkup? = null
2020-11-05 17:48:23 +00:00
) = editLiveLocation(chat.id, messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
2020-02-15 09:33:04 +00:00
2021-10-01 13:38:22 +00:00
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.editLiveLocation(
2020-02-15 09:33:04 +00:00
message: ContentMessage<LocationContent>,
latitude: Double,
longitude: Double,
2020-11-05 17:48:23 +00:00
horizontalAccuracy: Meters? = null,
heading: Degrees? = null,
proximityAlertRadius: Meters? = null,
2020-02-15 09:33:04 +00:00
replyMarkup: InlineKeyboardMarkup? = null
2020-11-05 17:48:23 +00:00
) = editLiveLocation(message.chat, message.messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
2020-02-15 09:33:04 +00:00
2021-10-01 13:38:22 +00:00
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.editLiveLocation(
2020-02-15 09:33:04 +00:00
chatId: ChatIdentifier,
messageId: MessageIdentifier,
2020-11-05 17:48:23 +00:00
location: LiveLocation,
2020-02-15 09:33:04 +00:00
replyMarkup: InlineKeyboardMarkup? = null
) = execute(
EditChatMessageLiveLocation(
2020-11-05 17:48:23 +00:00
chatId, messageId, location.latitude, location.longitude, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, replyMarkup
2020-02-15 09:33:04 +00:00
)
)
2021-10-01 13:38:22 +00:00
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.editLiveLocation(
2020-02-15 09:33:04 +00:00
chat: Chat,
messageId: MessageIdentifier,
2020-11-05 17:48:23 +00:00
location: LiveLocation,
2020-02-15 09:33:04 +00:00
replyMarkup: InlineKeyboardMarkup? = null
2020-11-05 17:48:23 +00:00
) = editLiveLocation(chat.id, messageId, location.latitude, location.longitude, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, replyMarkup)
2020-02-15 09:33:04 +00:00
2021-10-01 13:38:22 +00:00
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.editLiveLocation(
2020-02-15 09:33:04 +00:00
message: ContentMessage<LocationContent>,
2020-11-05 17:48:23 +00:00
location: LiveLocation,
2020-02-15 09:33:04 +00:00
replyMarkup: InlineKeyboardMarkup? = null
2020-11-05 17:48:23 +00:00
) = editLiveLocation(message.chat, message.messageId, location.latitude, location.longitude, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, replyMarkup)