2020-10-04 10:57:39 +00:00
package dev.inmo.tgbotapi.extensions.api.send.media
2020-02-15 09:33:04 +00:00
2020-11-05 17:48:23 +00:00
import dev.inmo.tgbotapi.CommonAbstracts.TextSource
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.SendPhoto
import dev.inmo.tgbotapi.types.ChatIdentifier
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.Photo
import dev.inmo.tgbotapi.types.files.biggest
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 . sendPhoto (
2020-02-15 09:33:04 +00:00
chatId : ChatIdentifier ,
2020-02-23 15:29:31 +00:00
fileId : InputFile ,
2020-02-15 09:33:04 +00:00
caption : String ? = null ,
parseMode : ParseMode ? = null ,
disableNotification : Boolean = false ,
replyToMessageId : MessageIdentifier ? = null ,
2020-11-05 17:48:23 +00:00
allowSendingWithoutReply : Boolean ? = null ,
2020-02-15 09:33:04 +00:00
replyMarkup : KeyboardMarkup ? = null
) = execute (
SendPhoto (
chatId ,
fileId ,
caption ,
parseMode ,
disableNotification ,
replyToMessageId ,
2020-11-05 17:48:23 +00:00
allowSendingWithoutReply ,
2020-02-15 09:33:04 +00:00
replyMarkup
)
)
2020-10-04 10:47:30 +00:00
suspend fun TelegramBot . sendPhoto (
chat : Chat ,
fileId : InputFile ,
caption : String ? = null ,
parseMode : ParseMode ? = null ,
disableNotification : Boolean = false ,
replyToMessageId : MessageIdentifier ? = null ,
2020-11-05 17:48:23 +00:00
allowSendingWithoutReply : Boolean ? = null ,
2020-10-04 10:47:30 +00:00
replyMarkup : KeyboardMarkup ? = null
2020-11-05 17:48:23 +00:00
) = sendPhoto ( chat . id , fileId , caption , parseMode , disableNotification , replyToMessageId , allowSendingWithoutReply , replyMarkup )
2020-10-04 10:47:30 +00:00
suspend fun TelegramBot . sendPhoto (
chatId : ChatIdentifier ,
photo : Photo ,
caption : String ? = null ,
parseMode : ParseMode ? = null ,
disableNotification : Boolean = false ,
replyToMessageId : MessageIdentifier ? = null ,
2020-11-05 17:48:23 +00:00
allowSendingWithoutReply : Boolean ? = null ,
2020-10-04 10:47:30 +00:00
replyMarkup : KeyboardMarkup ? = null
2020-11-05 17:48:23 +00:00
) = sendPhoto ( chatId , photo . biggest ( ) ?. fileId ?: error ( " Photo content must not be empty " ) , caption , parseMode , disableNotification , replyToMessageId , allowSendingWithoutReply , replyMarkup )
2020-10-04 10:47:30 +00:00
suspend fun TelegramBot . sendPhoto (
chat : Chat ,
photo : Photo ,
caption : String ? = null ,
parseMode : ParseMode ? = null ,
disableNotification : Boolean = false ,
replyToMessageId : MessageIdentifier ? = null ,
2020-11-05 17:48:23 +00:00
allowSendingWithoutReply : Boolean ? = null ,
2020-10-04 10:47:30 +00:00
replyMarkup : KeyboardMarkup ? = null
2020-11-05 17:48:23 +00:00
) = sendPhoto ( chat . id , photo , caption , parseMode , disableNotification , replyToMessageId , allowSendingWithoutReply , replyMarkup )
2020-10-04 10:47:30 +00:00
suspend inline fun TelegramBot . replyWithPhoto (
to : Message ,
fileId : InputFile ,
caption : String ? = null ,
parseMode : ParseMode ? = null ,
disableNotification : Boolean = false ,
2020-11-05 17:48:23 +00:00
allowSendingWithoutReply : Boolean ? = null ,
2020-10-04 10:47:30 +00:00
replyMarkup : KeyboardMarkup ? = null
2020-11-05 17:48:23 +00:00
) = sendPhoto ( to . chat , fileId , caption , parseMode , disableNotification , to . messageId , allowSendingWithoutReply , replyMarkup )
2020-10-04 10:47:30 +00:00
suspend inline fun TelegramBot . replyWithPhoto (
to : Message ,
photo : Photo ,
caption : String ? = null ,
parseMode : ParseMode ? = null ,
disableNotification : Boolean = false ,
2020-11-05 17:48:23 +00:00
allowSendingWithoutReply : Boolean ? = null ,
2020-10-04 10:47:30 +00:00
replyMarkup : KeyboardMarkup ? = null
2020-11-05 17:48:23 +00:00
) = sendPhoto ( to . chat , photo , caption , parseMode , disableNotification , to . messageId , allowSendingWithoutReply , replyMarkup )
2020-10-04 10:47:30 +00:00
suspend inline fun TelegramBot . reply (
to : Message ,
photo : Photo ,
caption : String ? = null ,
parseMode : ParseMode ? = null ,
disableNotification : Boolean = false ,
2020-11-05 17:48:23 +00:00
allowSendingWithoutReply : Boolean ? = null ,
2020-10-04 10:47:30 +00:00
replyMarkup : KeyboardMarkup ? = null
2020-11-05 17:48:23 +00:00
) = replyWithPhoto ( to , photo , caption , parseMode , disableNotification , allowSendingWithoutReply , replyMarkup )
suspend inline fun TelegramBot . sendPhoto (
chatId : ChatIdentifier ,
fileId : InputFile ,
entities : List < TextSource > ,
disableNotification : Boolean = false ,
replyToMessageId : MessageIdentifier ? = null ,
allowSendingWithoutReply : Boolean ? = null ,
replyMarkup : KeyboardMarkup ? = null
) = execute (
SendPhoto (
chatId ,
fileId ,
entities ,
disableNotification ,
replyToMessageId ,
allowSendingWithoutReply ,
replyMarkup
)
)
suspend inline fun TelegramBot . sendPhoto (
chat : Chat ,
fileId : InputFile ,
entities : List < TextSource > ,
disableNotification : Boolean = false ,
replyToMessageId : MessageIdentifier ? = null ,
allowSendingWithoutReply : Boolean ? = null ,
replyMarkup : KeyboardMarkup ? = null
) = sendPhoto ( chat . id , fileId , entities , disableNotification , replyToMessageId , allowSendingWithoutReply , replyMarkup )
suspend inline fun TelegramBot . sendPhoto (
chatId : ChatIdentifier ,
photo : Photo ,
entities : List < TextSource > ,
disableNotification : Boolean = false ,
replyToMessageId : MessageIdentifier ? = null ,
allowSendingWithoutReply : Boolean ? = null ,
replyMarkup : KeyboardMarkup ? = null
) = sendPhoto ( chatId , photo . biggest ( ) ?. fileId ?: error ( " Photo content must not be empty " ) , entities , disableNotification , replyToMessageId , allowSendingWithoutReply , replyMarkup )
suspend inline fun TelegramBot . sendPhoto (
chat : Chat ,
photo : Photo ,
entities : List < TextSource > ,
disableNotification : Boolean = false ,
replyToMessageId : MessageIdentifier ? = null ,
allowSendingWithoutReply : Boolean ? = null ,
replyMarkup : KeyboardMarkup ? = null
) = sendPhoto ( chat . id , photo , entities , disableNotification , replyToMessageId , allowSendingWithoutReply , replyMarkup )
suspend inline fun TelegramBot . replyWithPhoto (
to : Message ,
fileId : InputFile ,
entities : List < TextSource > ,
disableNotification : Boolean = false ,
allowSendingWithoutReply : Boolean ? = null ,
replyMarkup : KeyboardMarkup ? = null
) = sendPhoto ( to . chat , fileId , entities , disableNotification , to . messageId , allowSendingWithoutReply , replyMarkup )
suspend inline fun TelegramBot . replyWithPhoto (
to : Message ,
photo : Photo ,
entities : List < TextSource > ,
disableNotification : Boolean = false ,
allowSendingWithoutReply : Boolean ? = null ,
replyMarkup : KeyboardMarkup ? = null
) = sendPhoto ( to . chat , photo , entities , disableNotification , to . messageId , allowSendingWithoutReply , replyMarkup )
suspend inline fun TelegramBot . reply (
to : Message ,
photo : Photo ,
entities : List < TextSource > ,
disableNotification : Boolean = false ,
allowSendingWithoutReply : Boolean ? = null ,
replyMarkup : KeyboardMarkup ? = null
) = replyWithPhoto ( to , photo , entities , disableNotification , allowSendingWithoutReply , replyMarkup )