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-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
2022-05-01 14:36:07 +00:00
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
2022-09-14 18:17:18 +00:00
import dev.inmo.tgbotapi.types.MessageId
2022-05-01 14:43:03 +00:00
import dev.inmo.tgbotapi.types.message.ParseMode
2020-10-04 11:06:30 +00:00
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
2022-04-21 18:16:41 +00:00
import dev.inmo.tgbotapi.types.chat.Chat
2022-03-24 10:46:33 +00:00
import dev.inmo.tgbotapi.types.files.*
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 . sendPhoto (
2020-02-15 09:33:04 +00:00
chatId : ChatIdentifier ,
2020-02-23 15:29:31 +00:00
fileId : InputFile ,
2021-04-26 15:25:52 +00:00
text : String ? = null ,
2020-02-15 09:33:04 +00:00
parseMode : ParseMode ? = null ,
disableNotification : Boolean = false ,
2022-01-01 14:13:22 +00:00
protectContent : Boolean = false ,
2022-09-14 18:17:18 +00:00
replyToMessageId : MessageId ? = 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 ,
2021-04-26 15:25:52 +00:00
text ,
2020-02-15 09:33:04 +00:00
parseMode ,
disableNotification ,
2022-01-01 14:13:22 +00:00
protectContent ,
2020-02-15 09:33:04 +00:00
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
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 . sendPhoto (
chat : Chat ,
fileId : InputFile ,
2021-04-26 15:25:52 +00:00
text : String ? = null ,
2020-10-04 10:47:30 +00:00
parseMode : ParseMode ? = null ,
disableNotification : Boolean = false ,
2022-01-01 14:13:22 +00:00
protectContent : Boolean = false ,
2022-09-14 18:17:18 +00:00
replyToMessageId : MessageId ? = null ,
2020-11-05 17:48:23 +00:00
allowSendingWithoutReply : Boolean ? = null ,
2020-10-04 10:47:30 +00:00
replyMarkup : KeyboardMarkup ? = null
2022-01-01 14:13:22 +00:00
) = sendPhoto ( chat . id , fileId , text , parseMode , disableNotification , protectContent , replyToMessageId , allowSendingWithoutReply , replyMarkup )
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 . sendPhoto (
chatId : ChatIdentifier ,
photo : Photo ,
2021-04-26 15:25:52 +00:00
text : String ? = null ,
2020-10-04 10:47:30 +00:00
parseMode : ParseMode ? = null ,
disableNotification : Boolean = false ,
2022-01-01 14:13:22 +00:00
protectContent : Boolean = false ,
2022-09-14 18:17:18 +00:00
replyToMessageId : MessageId ? = null ,
2020-11-05 17:48:23 +00:00
allowSendingWithoutReply : Boolean ? = null ,
2020-10-04 10:47:30 +00:00
replyMarkup : KeyboardMarkup ? = null
2022-01-01 14:13:22 +00:00
) = sendPhoto ( chatId , photo . biggest ( ) ?. fileId ?: error ( " Photo content must not be empty " ) , text , parseMode , disableNotification , protectContent , replyToMessageId , allowSendingWithoutReply , replyMarkup )
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 . sendPhoto (
chat : Chat ,
photo : Photo ,
2021-04-26 15:25:52 +00:00
text : String ? = null ,
2020-10-04 10:47:30 +00:00
parseMode : ParseMode ? = null ,
disableNotification : Boolean = false ,
2022-01-01 14:13:22 +00:00
protectContent : Boolean = false ,
2022-09-14 18:17:18 +00:00
replyToMessageId : MessageId ? = null ,
2020-11-05 17:48:23 +00:00
allowSendingWithoutReply : Boolean ? = null ,
2020-10-04 10:47:30 +00:00
replyMarkup : KeyboardMarkup ? = null
2022-01-01 14:13:22 +00:00
) = sendPhoto ( chat . id , photo , text , parseMode , disableNotification , protectContent , replyToMessageId , allowSendingWithoutReply , replyMarkup )
2020-10-04 10:47:30 +00:00
2022-03-24 10:46:33 +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 . sendPhoto (
chatId : ChatIdentifier ,
photoSize : PhotoSize ,
text : String ? = null ,
parseMode : ParseMode ? = null ,
disableNotification : Boolean = false ,
protectContent : Boolean = false ,
2022-09-14 18:17:18 +00:00
replyToMessageId : MessageId ? = null ,
2022-03-24 10:46:33 +00:00
allowSendingWithoutReply : Boolean ? = null ,
replyMarkup : KeyboardMarkup ? = null
) = sendPhoto ( chatId , photoSize . fileId , text , parseMode , 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 . sendPhoto (
chat : Chat ,
photoSize : PhotoSize ,
text : String ? = null ,
parseMode : ParseMode ? = null ,
disableNotification : Boolean = false ,
protectContent : Boolean = false ,
2022-09-14 18:17:18 +00:00
replyToMessageId : MessageId ? = null ,
2022-03-24 10:46:33 +00:00
allowSendingWithoutReply : Boolean ? = null ,
replyMarkup : KeyboardMarkup ? = null
) = sendPhoto ( chat . id , photoSize , text , parseMode , disableNotification , protectContent , replyToMessageId , allowSendingWithoutReply , replyMarkup )
2020-11-05 17:48:23 +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 . sendPhoto (
chatId : ChatIdentifier ,
fileId : InputFile ,
2021-05-29 09:34:14 +00:00
entities : TextSourcesList ,
2020-11-05 17:48:23 +00:00
disableNotification : Boolean = false ,
2022-01-01 14:13:22 +00:00
protectContent : Boolean = false ,
2022-09-14 18:17:18 +00:00
replyToMessageId : MessageId ? = null ,
2020-11-05 17:48:23 +00:00
allowSendingWithoutReply : Boolean ? = null ,
replyMarkup : KeyboardMarkup ? = null
) = execute (
SendPhoto (
chatId ,
fileId ,
entities ,
disableNotification ,
2022-01-01 14:13:22 +00:00
protectContent ,
2020-11-05 17:48:23 +00:00
replyToMessageId ,
allowSendingWithoutReply ,
replyMarkup
)
)
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 . sendPhoto (
chat : Chat ,
fileId : InputFile ,
2021-05-29 09:34:14 +00:00
entities : TextSourcesList ,
2020-11-05 17:48:23 +00:00
disableNotification : Boolean = false ,
2022-01-01 14:13:22 +00:00
protectContent : Boolean = false ,
2022-09-14 18:17:18 +00:00
replyToMessageId : MessageId ? = null ,
2020-11-05 17:48:23 +00:00
allowSendingWithoutReply : Boolean ? = null ,
replyMarkup : KeyboardMarkup ? = null
2022-01-01 14:13:22 +00:00
) = sendPhoto ( chat . id , fileId , entities , disableNotification , protectContent , replyToMessageId , allowSendingWithoutReply , replyMarkup )
2020-11-05 17:48:23 +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 . sendPhoto (
chatId : ChatIdentifier ,
photo : Photo ,
2021-05-29 09:34:14 +00:00
entities : TextSourcesList ,
2020-11-05 17:48:23 +00:00
disableNotification : Boolean = false ,
2022-01-01 14:13:22 +00:00
protectContent : Boolean = false ,
2022-09-14 18:17:18 +00:00
replyToMessageId : MessageId ? = null ,
2020-11-05 17:48:23 +00:00
allowSendingWithoutReply : Boolean ? = null ,
replyMarkup : KeyboardMarkup ? = null
2022-01-01 14:13:22 +00:00
) = sendPhoto ( chatId , photo . biggest ( ) ?. fileId ?: error ( " Photo content must not be empty " ) , entities , disableNotification , protectContent , replyToMessageId , allowSendingWithoutReply , replyMarkup )
2020-11-05 17:48:23 +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 . sendPhoto (
chat : Chat ,
photo : Photo ,
2021-05-29 09:34:14 +00:00
entities : TextSourcesList ,
2020-11-05 17:48:23 +00:00
disableNotification : Boolean = false ,
2022-01-01 14:13:22 +00:00
protectContent : Boolean = false ,
2022-09-14 18:17:18 +00:00
replyToMessageId : MessageId ? = null ,
2020-11-05 17:48:23 +00:00
allowSendingWithoutReply : Boolean ? = null ,
replyMarkup : KeyboardMarkup ? = null
2022-01-01 14:13:22 +00:00
) = sendPhoto ( chat . id , photo , entities , disableNotification , protectContent , replyToMessageId , allowSendingWithoutReply , replyMarkup )
2022-03-24 10:46:33 +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 inline fun TelegramBot . sendPhoto (
chatId : ChatIdentifier ,
photoSize : PhotoSize ,
entities : TextSourcesList ,
disableNotification : Boolean = false ,
protectContent : Boolean = false ,
2022-09-14 18:17:18 +00:00
replyToMessageId : MessageId ? = null ,
2022-03-24 10:46:33 +00:00
allowSendingWithoutReply : Boolean ? = null ,
replyMarkup : KeyboardMarkup ? = null
) = sendPhoto ( chatId , photoSize . fileId , entities , 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 inline fun TelegramBot . sendPhoto (
chat : Chat ,
photoSize : PhotoSize ,
entities : TextSourcesList ,
disableNotification : Boolean = false ,
protectContent : Boolean = false ,
2022-09-14 18:17:18 +00:00
replyToMessageId : MessageId ? = null ,
2022-03-24 10:46:33 +00:00
allowSendingWithoutReply : Boolean ? = null ,
replyMarkup : KeyboardMarkup ? = null
) = sendPhoto ( chat . id , photoSize , entities , disableNotification , protectContent , replyToMessageId , allowSendingWithoutReply , replyMarkup )