1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-06-17 23:35:27 +00:00
tgbotapi/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/LiveLocation/EditChatMessageLiveLocation.kt

71 lines
2.8 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
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
)
)
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
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
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
)
)
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
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)