1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-06-01 23:45:25 +00:00
tgbotapi/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendLocation.kt

101 lines
2.4 KiB
Kotlin
Raw Normal View History

package dev.inmo.tgbotapi.extensions.api.send
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.send.SendLocation
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
import dev.inmo.tgbotapi.types.message.abstracts.Message
2020-02-15 09:33:04 +00:00
suspend fun TelegramBot.sendLocation(
2020-02-15 09:33:04 +00:00
chatId: ChatIdentifier,
latitude: Double,
longitude: Double,
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
replyMarkup: KeyboardMarkup? = null
) = execute(
SendLocation(
chatId,
latitude,
longitude,
disableNotification = disableNotification,
replyToMessageId = replyToMessageId,
replyMarkup = replyMarkup
)
)
suspend fun TelegramBot.sendLocation(
2020-02-15 09:33:04 +00:00
chatId: ChatIdentifier,
location: Location,
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
replyMarkup: KeyboardMarkup? = null
) = sendLocation(
chatId,
location.latitude,
location.longitude,
disableNotification,
replyToMessageId,
replyMarkup
)
suspend fun TelegramBot.sendLocation(
2020-02-15 09:33:04 +00:00
chat: Chat,
latitude: Double,
longitude: Double,
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
replyMarkup: KeyboardMarkup? = null
) = sendLocation(
chat.id,
latitude,
longitude,
disableNotification,
replyToMessageId,
replyMarkup
)
suspend fun TelegramBot.sendLocation(
2020-02-15 09:33:04 +00:00
chat: Chat,
location: Location,
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
replyMarkup: KeyboardMarkup? = null
) = sendLocation(
chat.id,
location.latitude,
location.longitude,
disableNotification,
replyToMessageId,
replyMarkup
)
2020-10-04 10:47:30 +00:00
suspend inline fun TelegramBot.reply(
to: Message,
latitude: Double,
longitude: Double,
disableNotification: Boolean = false,
replyMarkup: KeyboardMarkup? = null
) = sendLocation(
to.chat,
latitude,
longitude,
disableNotification,
to.messageId,
replyMarkup
)
suspend inline fun TelegramBot.reply(
to: Message,
location: Location,
disableNotification: Boolean = false,
replyMarkup: KeyboardMarkup? = null
) = sendLocation(
to.chat,
location,
disableNotification,
to.messageId,
replyMarkup
)