tgbotapi/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendDocument.kt

170 lines
6.8 KiB
Kotlin
Raw Normal View History

package dev.inmo.tgbotapi.extensions.api.send.media
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.abstracts.InputFile
import dev.inmo.tgbotapi.requests.send.media.SendDocument
import dev.inmo.tgbotapi.types.ChatIdentifier
2021-05-29 09:34:14 +00:00
import dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSourcesList
2020-10-04 11:06:30 +00:00
import dev.inmo.tgbotapi.types.MessageIdentifier
import dev.inmo.tgbotapi.types.ParseMode.ParseMode
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
import dev.inmo.tgbotapi.types.files.DocumentFile
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
*/
suspend fun TelegramBot.sendDocument(
2020-02-15 09:33:04 +00:00
chatId: ChatIdentifier,
document: InputFile,
thumb: InputFile? = null,
2020-02-15 09:33:04 +00:00
text: String? = null,
parseMode: ParseMode? = null,
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
2020-11-05 17:48:23 +00:00
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null
2020-02-15 09:33:04 +00:00
) = execute(
SendDocument(
chatId,
document,
thumb,
text,
parseMode,
disableNotification,
replyToMessageId,
2020-11-05 17:48:23 +00:00
allowSendingWithoutReply,
replyMarkup,
disableContentTypeDetection
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 10:47:30 +00:00
suspend fun TelegramBot.sendDocument(
chat: Chat,
document: InputFile,
thumb: InputFile? = null,
text: String? = null,
parseMode: ParseMode? = null,
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
2020-11-05 17:48:23 +00:00
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null
) = sendDocument(chat.id, document, thumb, text, parseMode, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)
2020-10-04 10:47:30 +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
*/
suspend fun TelegramBot.sendDocument(
2020-02-15 09:33:04 +00:00
chatId: ChatIdentifier,
document: DocumentFile,
text: String? = null,
parseMode: ParseMode? = null,
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
2020-11-05 17:48:23 +00:00
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null
2020-02-15 09:33:04 +00:00
) = sendDocument(
2020-11-05 17:48:23 +00:00
chatId, document.fileId, document.thumb ?.fileId, text, parseMode, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection
2020-02-15 09:33:04 +00:00
)
2020-10-04 10:47:30 +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 10:47:30 +00:00
suspend fun TelegramBot.sendDocument(
chat: Chat,
document: DocumentFile,
text: String? = null,
parseMode: ParseMode? = null,
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
2020-11-05 17:48:23 +00:00
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null
) = sendDocument(chat.id, document, text, parseMode, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)
2020-10-04 10:47:30 +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-11-05 17:48:23 +00:00
suspend inline fun TelegramBot.sendDocument(
chatId: ChatIdentifier,
document: InputFile,
thumb: InputFile? = null,
2021-05-29 09:34:14 +00:00
entities: TextSourcesList,
2020-11-05 17:48:23 +00:00
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null
) = execute(
SendDocument(
chatId,
document,
thumb,
entities,
disableNotification,
replyToMessageId,
allowSendingWithoutReply,
replyMarkup,
disableContentTypeDetection
)
)
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-11-05 17:48:23 +00:00
suspend inline fun TelegramBot.sendDocument(
chat: Chat,
document: InputFile,
thumb: InputFile? = null,
2021-05-29 09:34:14 +00:00
entities: TextSourcesList,
2020-11-05 17:48:23 +00:00
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null
) = sendDocument(chat.id, document, thumb, entities, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)
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-11-05 17:48:23 +00:00
suspend inline fun TelegramBot.sendDocument(
chatId: ChatIdentifier,
document: DocumentFile,
2021-05-29 09:34:14 +00:00
entities: TextSourcesList,
2020-11-05 17:48:23 +00:00
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null
) = sendDocument(
chatId, document.fileId, document.thumb ?.fileId, entities, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection
)
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-11-05 17:48:23 +00:00
suspend inline fun TelegramBot.sendDocument(
chat: Chat,
document: DocumentFile,
2021-05-29 09:34:14 +00:00
entities: TextSourcesList,
2020-11-05 17:48:23 +00:00
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null
) = sendDocument(chat.id, document, entities, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)