mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-09-20 17:46:08 +00:00
80 lines
3.0 KiB
Kotlin
80 lines
3.0 KiB
Kotlin
package dev.inmo.tgbotapi.extensions.api.send
|
|
|
|
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
|
|
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
|
|
|
/**
|
|
* @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
|
|
*/
|
|
suspend fun TelegramBot.sendContact(
|
|
chatId: ChatIdentifier,
|
|
phoneNumber: String,
|
|
firstName: String,
|
|
lastName: String? = null,
|
|
disableNotification: Boolean = false,
|
|
protectContent: Boolean = false,
|
|
replyToMessageId: MessageIdentifier? = null,
|
|
allowSendingWithoutReply: Boolean? = null,
|
|
replyMarkup: KeyboardMarkup? = null
|
|
) = execute(
|
|
SendContact(
|
|
chatId, phoneNumber, firstName, lastName, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
|
)
|
|
)
|
|
|
|
/**
|
|
* @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
|
|
*/
|
|
suspend fun TelegramBot.sendContact(
|
|
chatId: ChatIdentifier,
|
|
contact: Contact,
|
|
disableNotification: Boolean = false,
|
|
protectContent: Boolean = false,
|
|
replyToMessageId: MessageIdentifier? = null,
|
|
allowSendingWithoutReply: Boolean? = null,
|
|
replyMarkup: KeyboardMarkup? = null
|
|
) = execute(
|
|
SendContact(
|
|
chatId, contact, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
|
)
|
|
)
|
|
|
|
/**
|
|
* @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
|
|
*/
|
|
suspend fun TelegramBot.sendContact(
|
|
chat: Chat,
|
|
phoneNumber: String,
|
|
firstName: String,
|
|
lastName: String? = null,
|
|
disableNotification: Boolean = false,
|
|
protectContent: Boolean = false,
|
|
replyToMessageId: MessageIdentifier? = null,
|
|
allowSendingWithoutReply: Boolean? = null,
|
|
replyMarkup: KeyboardMarkup? = null
|
|
) = sendContact(
|
|
chat.id, phoneNumber, firstName, lastName, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
|
)
|
|
|
|
/**
|
|
* @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
|
|
*/
|
|
suspend fun TelegramBot.sendContact(
|
|
chat: Chat,
|
|
contact: Contact,
|
|
disableNotification: Boolean = false,
|
|
protectContent: Boolean = false,
|
|
replyToMessageId: MessageIdentifier? = null,
|
|
allowSendingWithoutReply: Boolean? = null,
|
|
replyMarkup: KeyboardMarkup? = null
|
|
) = sendContact(
|
|
chat.id, contact, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
|
)
|