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.SendContact
|
|
|
|
import dev.inmo.tgbotapi.types.*
|
|
|
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
2022-04-21 18:16:41 +00:00
|
|
|
import dev.inmo.tgbotapi.types.chat.Chat
|
2020-02-15 09:33:04 +00:00
|
|
|
|
2021-10-01 13:38:22 +00:00
|
|
|
/**
|
|
|
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
|
|
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
|
|
*/
|
2020-10-04 07:18:24 +00:00
|
|
|
suspend fun TelegramBot.sendContact(
|
2020-02-15 09:33:04 +00:00
|
|
|
chatId: ChatIdentifier,
|
|
|
|
phoneNumber: String,
|
|
|
|
firstName: String,
|
|
|
|
lastName: String? = null,
|
2022-11-10 10:24:20 +00:00
|
|
|
threadId: MessageThreadId? = chatId.threadId,
|
2020-02-15 09:33:04 +00:00
|
|
|
disableNotification: Boolean = false,
|
2022-01-01 14:13:22 +00:00
|
|
|
protectContent: Boolean = false,
|
2024-01-07 16:42:46 +00:00
|
|
|
replyParameters: ReplyParameters? = null,
|
2020-02-15 09:33:04 +00:00
|
|
|
replyMarkup: KeyboardMarkup? = null
|
|
|
|
) = execute(
|
|
|
|
SendContact(
|
2024-01-07 16:42:46 +00:00
|
|
|
chatId, phoneNumber, firstName, lastName, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
2020-02-15 09:33:04 +00:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2021-10-01 13:38:22 +00:00
|
|
|
/**
|
|
|
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
|
|
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
|
|
*/
|
2020-10-04 07:18:24 +00:00
|
|
|
suspend fun TelegramBot.sendContact(
|
2020-02-15 09:33:04 +00:00
|
|
|
chatId: ChatIdentifier,
|
|
|
|
contact: Contact,
|
2022-11-10 10:24:20 +00:00
|
|
|
threadId: MessageThreadId? = chatId.threadId,
|
2020-02-15 09:33:04 +00:00
|
|
|
disableNotification: Boolean = false,
|
2022-01-01 14:13:22 +00:00
|
|
|
protectContent: Boolean = false,
|
2024-01-07 16:42:46 +00:00
|
|
|
replyParameters: ReplyParameters? = null,
|
2020-02-15 09:33:04 +00:00
|
|
|
replyMarkup: KeyboardMarkup? = null
|
|
|
|
) = execute(
|
|
|
|
SendContact(
|
2024-01-07 16:42:46 +00:00
|
|
|
chatId, contact, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
2020-02-15 09:33:04 +00:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2021-10-01 13:38:22 +00:00
|
|
|
/**
|
|
|
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
|
|
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
|
|
*/
|
2020-10-04 07:18:24 +00:00
|
|
|
suspend fun TelegramBot.sendContact(
|
2020-02-15 09:33:04 +00:00
|
|
|
chat: Chat,
|
|
|
|
phoneNumber: String,
|
|
|
|
firstName: String,
|
|
|
|
lastName: String? = null,
|
2022-11-10 10:24:20 +00:00
|
|
|
threadId: MessageThreadId? = chat.id.threadId,
|
2020-02-15 09:33:04 +00:00
|
|
|
disableNotification: Boolean = false,
|
2022-01-01 14:13:22 +00:00
|
|
|
protectContent: Boolean = false,
|
2024-01-07 16:42:46 +00:00
|
|
|
replyParameters: ReplyParameters? = null,
|
2020-02-15 09:33:04 +00:00
|
|
|
replyMarkup: KeyboardMarkup? = null
|
|
|
|
) = sendContact(
|
2024-01-07 16:42:46 +00:00
|
|
|
chat.id, phoneNumber, firstName, lastName, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
2020-02-15 09:33:04 +00:00
|
|
|
)
|
|
|
|
|
2021-10-01 13:38:22 +00:00
|
|
|
/**
|
|
|
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
|
|
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
|
|
*/
|
2020-10-04 07:18:24 +00:00
|
|
|
suspend fun TelegramBot.sendContact(
|
2020-02-15 09:33:04 +00:00
|
|
|
chat: Chat,
|
|
|
|
contact: Contact,
|
2022-11-10 10:24:20 +00:00
|
|
|
threadId: MessageThreadId? = chat.id.threadId,
|
2020-02-15 09:33:04 +00:00
|
|
|
disableNotification: Boolean = false,
|
2022-01-01 14:13:22 +00:00
|
|
|
protectContent: Boolean = false,
|
2024-01-07 16:42:46 +00:00
|
|
|
replyParameters: ReplyParameters? = null,
|
2020-02-15 09:33:04 +00:00
|
|
|
replyMarkup: KeyboardMarkup? = null
|
|
|
|
) = sendContact(
|
2024-01-07 16:42:46 +00:00
|
|
|
chat.id, contact, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
2020-02-15 09:33:04 +00:00
|
|
|
)
|