2020-10-04 10:57:39 +00:00
|
|
|
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
|
2020-11-04 19:12:14 +00:00
|
|
|
import dev.inmo.tgbotapi.types.location.StaticLocation
|
2020-10-04 11:06:30 +00:00
|
|
|
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
2020-02-15 09:33:04 +00:00
|
|
|
|
2020-10-04 07:18:24 +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
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2020-10-04 07:18:24 +00:00
|
|
|
suspend fun TelegramBot.sendLocation(
|
2020-02-15 09:33:04 +00:00
|
|
|
chatId: ChatIdentifier,
|
2020-11-04 19:12:14 +00:00
|
|
|
location: StaticLocation,
|
2020-02-15 09:33:04 +00:00
|
|
|
disableNotification: Boolean = false,
|
|
|
|
replyToMessageId: MessageIdentifier? = null,
|
|
|
|
replyMarkup: KeyboardMarkup? = null
|
|
|
|
) = sendLocation(
|
|
|
|
chatId,
|
|
|
|
location.latitude,
|
|
|
|
location.longitude,
|
|
|
|
disableNotification,
|
|
|
|
replyToMessageId,
|
|
|
|
replyMarkup
|
|
|
|
)
|
|
|
|
|
2020-10-04 07:18:24 +00:00
|
|
|
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
|
|
|
|
)
|
|
|
|
|
2020-10-04 07:18:24 +00:00
|
|
|
suspend fun TelegramBot.sendLocation(
|
2020-02-15 09:33:04 +00:00
|
|
|
chat: Chat,
|
2020-11-04 19:12:14 +00:00
|
|
|
location: StaticLocation,
|
2020-02-15 09:33:04 +00:00
|
|
|
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,
|
2020-11-04 19:12:14 +00:00
|
|
|
location: StaticLocation,
|
2020-10-04 10:47:30 +00:00
|
|
|
disableNotification: Boolean = false,
|
|
|
|
replyMarkup: KeyboardMarkup? = null
|
|
|
|
) = sendLocation(
|
|
|
|
to.chat,
|
|
|
|
location,
|
|
|
|
disableNotification,
|
|
|
|
to.messageId,
|
|
|
|
replyMarkup
|
|
|
|
)
|