1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-06-18 07:45:27 +00:00
tgbotapi/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/LiveLocation/EditChatMessageLiveLocation.kt

61 lines
2.3 KiB
Kotlin
Raw Normal View History

2020-02-15 09:33:04 +00:00
package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.edit.LiveLocation
import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot
2020-02-15 09:33:04 +00:00
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.LiveLocation.EditChatMessageLiveLocation
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.ContentMessage
import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.LocationContent
suspend fun TelegramBot.editLiveLocation(
2020-02-15 09:33:04 +00:00
chatId: ChatIdentifier,
messageId: MessageIdentifier,
latitude: Double,
longitude: Double,
replyMarkup: InlineKeyboardMarkup? = null
) = execute(
EditChatMessageLiveLocation(
chatId, messageId, latitude, longitude, replyMarkup
)
)
suspend fun TelegramBot.editLiveLocation(
2020-02-15 09:33:04 +00:00
chat: Chat,
messageId: MessageIdentifier,
latitude: Double,
longitude: Double,
replyMarkup: InlineKeyboardMarkup? = null
) = editLiveLocation(chat.id, messageId, latitude, longitude, replyMarkup)
suspend fun TelegramBot.editLiveLocation(
2020-02-15 09:33:04 +00:00
message: ContentMessage<LocationContent>,
latitude: Double,
longitude: Double,
replyMarkup: InlineKeyboardMarkup? = null
) = editLiveLocation(message.chat, message.messageId, latitude, longitude, replyMarkup)
suspend fun TelegramBot.editLiveLocation(
2020-02-15 09:33:04 +00:00
chatId: ChatIdentifier,
messageId: MessageIdentifier,
location: Location,
replyMarkup: InlineKeyboardMarkup? = null
) = execute(
EditChatMessageLiveLocation(
chatId, messageId, location.latitude, location.longitude, replyMarkup
)
)
suspend fun TelegramBot.editLiveLocation(
2020-02-15 09:33:04 +00:00
chat: Chat,
messageId: MessageIdentifier,
location: Location,
replyMarkup: InlineKeyboardMarkup? = null
) = editLiveLocation(chat.id, messageId, location.latitude, location.longitude, replyMarkup)
suspend fun TelegramBot.editLiveLocation(
2020-02-15 09:33:04 +00:00
message: ContentMessage<LocationContent>,
location: Location,
replyMarkup: InlineKeyboardMarkup? = null
) = editLiveLocation(message.chat, message.messageId, location.latitude, location.longitude, replyMarkup)