From d69b2e09d50f689abbb76636f01202f891341ad2 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Mon, 26 Apr 2021 21:25:52 +0600 Subject: [PATCH] migration from CaptionedInput --- .../tgbotapi/CommonAbstracts/Captioned.kt | 12 ++++++-- .../requests/send/media/SendAnimation.kt | 2 +- .../tgbotapi/requests/send/media/SendAudio.kt | 2 +- .../requests/send/media/SendDocument.kt | 2 +- .../tgbotapi/requests/send/media/SendPhoto.kt | 2 +- .../tgbotapi/requests/send/media/SendVideo.kt | 2 +- .../tgbotapi/requests/send/media/SendVoice.kt | 2 +- .../types/InputMedia/InputMediaAudio.kt | 2 +- .../types/InputMedia/InputMediaDocument.kt | 8 +++--- .../types/InputMedia/InputMediaPhoto.kt | 2 +- .../inmo/tgbotapi/types/files/VideoFile.kt | 2 +- .../dev/inmo/tgbotapi/types/games/Game.kt | 6 ++-- .../dev/inmo/tgbotapi/types/games/RawGame.kt | 8 +++--- .../content/abstracts/MediaGroupContent.kt | 2 +- .../message/content/media/AnimationContent.kt | 6 ++-- .../message/content/media/AudioContent.kt | 4 +-- .../message/content/media/DocumentContent.kt | 10 +++---- .../message/content/media/PhotoContent.kt | 4 +-- .../message/content/media/VideoContent.kt | 4 +-- .../message/content/media/VoiceContent.kt | 6 ++-- .../edit/caption/EditChatMessageCaption.kt | 7 ++--- .../extensions/api/send/media/SendPhoto.kt | 28 +++++++++---------- 22 files changed, 65 insertions(+), 58 deletions(-) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/CommonAbstracts/Captioned.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/CommonAbstracts/Captioned.kt index ac102469a5..1e3bfc3a08 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/CommonAbstracts/Captioned.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/CommonAbstracts/Captioned.kt @@ -2,15 +2,23 @@ package dev.inmo.tgbotapi.CommonAbstracts import dev.inmo.tgbotapi.types.ParseMode.ParseMode -interface Captioned { +const val CaptionDeprecation = "Captioned interface and others will be removed soon and not recommended to use" + +@Deprecated(CaptionDeprecation) +interface Captioned : Texted { + @Deprecated(CaptionDeprecation) val caption: String? + get() = text } -interface CaptionedInput : Captioned { +@Deprecated(CaptionDeprecation) +interface CaptionedInput : Captioned, TextedInput { /** * Full list of entities. This list WILL contain [TextPart]s with [dev.inmo.tgbotapi.types.MessageEntity.textsources.RegularTextSource] */ + @Deprecated(CaptionDeprecation) val captionEntities: List + get() = textEntities } /** diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendAnimation.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendAnimation.kt index 4e58cc23a4..4e8ea44666 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendAnimation.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendAnimation.kt @@ -20,7 +20,7 @@ fun SendAnimation( chatId: ChatIdentifier, animation: InputFile, thumb: InputFile? = null, - caption: String? = null, + text: String? = null, parseMode: ParseMode? = null, duration: Long? = null, width: Int? = null, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendAudio.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendAudio.kt index 82e15305a9..8cd2d2cf15 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendAudio.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendAudio.kt @@ -20,7 +20,7 @@ fun SendAudio( chatId: ChatIdentifier, audio: InputFile, thumb: InputFile? = null, - caption: String? = null, + text: String? = null, parseMode: ParseMode? = null, duration: Long? = null, performer: String? = null, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendDocument.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendDocument.kt index 6a515be8a4..d562c93175 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendDocument.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendDocument.kt @@ -29,7 +29,7 @@ fun SendDocument( chatId: ChatIdentifier, document: InputFile, thumb: InputFile? = null, - caption: String? = null, + text: String? = null, parseMode: ParseMode? = null, disableNotification: Boolean = false, replyToMessageId: MessageIdentifier? = null, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendPhoto.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendPhoto.kt index c492456f31..81c2de4b79 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendPhoto.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendPhoto.kt @@ -18,7 +18,7 @@ import kotlinx.serialization.* fun SendPhoto( chatId: ChatIdentifier, photo: InputFile, - caption: String? = null, + text: String? = null, parseMode: ParseMode? = null, disableNotification: Boolean = false, replyToMessageId: MessageIdentifier? = null, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendVideo.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendVideo.kt index 52e7ae8ba3..ec7849eba6 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendVideo.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendVideo.kt @@ -20,7 +20,7 @@ fun SendVideo( chatId: ChatIdentifier, video: InputFile, thumb: InputFile? = null, - caption: String? = null, + text: String? = null, parseMode: ParseMode? = null, duration: Long? = null, width: Int? = null, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendVoice.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendVoice.kt index 69e6d0f756..b382478398 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendVoice.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendVoice.kt @@ -19,7 +19,7 @@ import kotlinx.serialization.* fun SendVoice( chatId: ChatIdentifier, voice: InputFile, - caption: String? = null, + text: String? = null, parseMode: ParseMode? = null, duration: Long? = null, disableNotification: Boolean = false, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InputMedia/InputMediaAudio.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InputMedia/InputMediaAudio.kt index 5dc1aba16f..f6674becbb 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InputMedia/InputMediaAudio.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InputMedia/InputMediaAudio.kt @@ -62,7 +62,7 @@ data class InputMediaAudio internal constructor( } fun AudioFile.toInputMediaAudio( - caption: String? = null, + text: String? = null, parseMode: ParseMode? = null, title: String? = this.title ): InputMediaAudio = InputMediaAudio( diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InputMedia/InputMediaDocument.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InputMedia/InputMediaDocument.kt index 94e5af6b31..6772614459 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InputMedia/InputMediaDocument.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InputMedia/InputMediaDocument.kt @@ -13,11 +13,11 @@ internal const val documentInputMediaType = "document" fun InputMediaDocument( file: InputFile, - caption: String? = null, + text: String? = null, parseMode: ParseMode? = null, thumb: InputFile? = null, disableContentTypeDetection: Boolean? = null -) = InputMediaDocument(file, caption, parseMode, null, thumb, disableContentTypeDetection) +) = InputMediaDocument(file, text, parseMode, null, thumb, disableContentTypeDetection) fun InputMediaDocument( file: InputFile, @@ -62,11 +62,11 @@ data class InputMediaDocument internal constructor( } fun DocumentFile.toInputMediaDocument( - caption: String? = null, + text: String? = null, parseMode: ParseMode? = null ) = InputMediaDocument( fileId, - caption, + text, parseMode, thumb ?.fileId ) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InputMedia/InputMediaPhoto.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InputMedia/InputMediaPhoto.kt index 05ba4fb671..1442965791 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InputMedia/InputMediaPhoto.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InputMedia/InputMediaPhoto.kt @@ -46,7 +46,7 @@ data class InputMediaPhoto internal constructor( } fun PhotoSize.toInputMediaPhoto( - caption: String? = null, + text: String? = null, parseMode: ParseMode? = null ): InputMediaPhoto = InputMediaPhoto( fileId, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/files/VideoFile.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/files/VideoFile.kt index 45b4525896..aaff39b344 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/files/VideoFile.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/files/VideoFile.kt @@ -34,7 +34,7 @@ data class VideoFile( @Suppress("NOTHING_TO_INLINE") inline fun VideoFile.toInputMediaVideo( - caption: String? = null, + text: String? = null, parseMode: ParseMode? = null ) = InputMediaVideo( fileId, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/games/Game.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/games/Game.kt index 34043f6ad6..104411f5f1 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/games/Game.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/games/Game.kt @@ -8,7 +8,7 @@ data class Game( override val title: String, val description: String, val photo: Photo, - override val caption: String? = null, - override val captionEntities: List = emptyList(), + override val text: String? = null, + override val textEntities: List = emptyList(), val animation: AnimationFile? = null -) : Titled, CaptionedInput +) : Titled, CaptionedInput, TextedInput diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/games/RawGame.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/games/RawGame.kt index a48c195f78..7861092005 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/games/RawGame.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/games/RawGame.kt @@ -16,9 +16,9 @@ internal data class RawGame( @SerialName(photoField) private val photo: Photo, @SerialName(textField) - private val caption: String? = null, + private val text: String? = null, @SerialName(textEntitiesField) - private val captionEntities: RawMessageEntities = emptyList(), + private val textEntities: RawMessageEntities = emptyList(), @SerialName(animationField) private val animation: AnimationFile? = null ) { @@ -27,8 +27,8 @@ internal data class RawGame( title, description, photo, - caption, - caption ?.let { _ -> captionEntities.asTextParts(caption) } ?: emptyList(), + text, + text ?.let { _ -> textEntities.asTextParts(text) } ?: emptyList(), animation ) } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/abstracts/MediaGroupContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/abstracts/MediaGroupContent.kt index 7cf2eb6b16..7d80e16de4 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/abstracts/MediaGroupContent.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/abstracts/MediaGroupContent.kt @@ -3,7 +3,7 @@ package dev.inmo.tgbotapi.types.message.content.abstracts import dev.inmo.tgbotapi.CommonAbstracts.CaptionedInput import dev.inmo.tgbotapi.types.InputMedia.* -interface MediaGroupContent : MediaContent, CaptionedInput { +interface MediaGroupContent : MediaContent, CaptionedInput, TextedInput { fun toMediaGroupMemberInputMedia(): MediaGroupMemberInputMedia } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/media/AnimationContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/media/AnimationContent.kt index edbcb2312b..411446772e 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/media/AnimationContent.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/media/AnimationContent.kt @@ -15,9 +15,9 @@ import dev.inmo.tgbotapi.types.message.content.abstracts.MediaContent data class AnimationContent( override val media: AnimationFile, val includedDocument: DocumentFile?, - override val caption: String?, - override val captionEntities: List -) : MediaContent, CaptionedInput { + override val text: String?, + override val textEntities: List +) : MediaContent, CaptionedInput, TextedInput { override fun createResend( chatId: ChatIdentifier, disableNotification: Boolean, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/media/AudioContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/media/AudioContent.kt index 2d4f9a7148..f72f68b065 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/media/AudioContent.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/media/AudioContent.kt @@ -15,8 +15,8 @@ import dev.inmo.tgbotapi.types.message.content.abstracts.AudioMediaGroupContent data class AudioContent( override val media: AudioFile, - override val caption: String? = null, - override val captionEntities: List = emptyList() + override val text: String? = null, + override val textEntities: List = emptyList() ) : AudioMediaGroupContent { override fun createResend( chatId: ChatIdentifier, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/media/DocumentContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/media/DocumentContent.kt index 747cc77fdb..9a9be3d0cb 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/media/DocumentContent.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/media/DocumentContent.kt @@ -16,8 +16,8 @@ import dev.inmo.tgbotapi.types.message.content.abstracts.MediaContent data class DocumentContent( override val media: DocumentFile, - override val caption: String? = null, - override val captionEntities: List = emptyList() + override val text: String? = null, + override val textEntities: List = emptyList() ) : DocumentMediaGroupContent { override fun createResend( chatId: ChatIdentifier, @@ -43,10 +43,10 @@ data class DocumentContent( @Suppress("NOTHING_TO_INLINE") inline fun MediaContent.asDocumentContent() = when (this) { - is CaptionedInput -> DocumentContent( + is TextedInput -> DocumentContent( media.asDocumentFile(), - caption, - captionEntities + text, + textEntities ) else -> DocumentContent( media.asDocumentFile() diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/media/PhotoContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/media/PhotoContent.kt index 27fc6102fa..95ee54ddd4 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/media/PhotoContent.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/media/PhotoContent.kt @@ -16,8 +16,8 @@ import dev.inmo.tgbotapi.types.message.content.abstracts.VisualMediaGroupContent data class PhotoContent( override val mediaCollection: Photo, - override val caption: String? = null, - override val captionEntities: List = emptyList() + override val text: String? = null, + override val textEntities: List = emptyList() ) : MediaCollectionContent, VisualMediaGroupContent { override val media: PhotoSize = mediaCollection.biggest() ?: throw IllegalStateException("Can't locate any photo size for this content") diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/media/VideoContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/media/VideoContent.kt index 5b1ec9197b..86d794e3b4 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/media/VideoContent.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/media/VideoContent.kt @@ -15,8 +15,8 @@ import dev.inmo.tgbotapi.types.message.content.abstracts.VisualMediaGroupContent data class VideoContent( override val media: VideoFile, - override val caption: String? = null, - override val captionEntities: List = emptyList() + override val text: String? = null, + override val textEntities: List = emptyList() ) : VisualMediaGroupContent { override fun createResend( chatId: ChatIdentifier, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/media/VoiceContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/media/VoiceContent.kt index 421f2b6a75..0c682a34a2 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/media/VoiceContent.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/media/VoiceContent.kt @@ -13,9 +13,9 @@ import dev.inmo.tgbotapi.types.message.content.abstracts.MediaContent data class VoiceContent( override val media: VoiceFile, - override val caption: String? = null, - override val captionEntities: List = emptyList() -) : MediaContent, CaptionedInput { + override val text: String? = null, + override val textEntities: List = emptyList() +) : MediaContent, CaptionedInput, TextedInput { override fun createResend( chatId: ChatIdentifier, disableNotification: Boolean, diff --git a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/caption/EditChatMessageCaption.kt b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/caption/EditChatMessageCaption.kt index 1becc8e0d3..f5b5fd554e 100644 --- a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/caption/EditChatMessageCaption.kt +++ b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/caption/EditChatMessageCaption.kt @@ -1,7 +1,6 @@ package dev.inmo.tgbotapi.extensions.api.edit.caption -import dev.inmo.tgbotapi.CommonAbstracts.CaptionedInput -import dev.inmo.tgbotapi.CommonAbstracts.TextSource +import dev.inmo.tgbotapi.CommonAbstracts.* import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.edit.caption.EditChatMessageCaption import dev.inmo.tgbotapi.types.ChatIdentifier @@ -35,7 +34,7 @@ suspend fun TelegramBot.editMessageCaption( text: String, parseMode: ParseMode? = null, replyMarkup: InlineKeyboardMarkup? = null -): ContentMessage where T : CaptionedInput, T : MediaContent { +): ContentMessage where T : TextedInput, T : MediaContent { return editMessageCaption(message.chat.id, message.messageId, text, parseMode, replyMarkup) } @@ -59,6 +58,6 @@ suspend fun TelegramBot.editMessageCaption( message: ContentMessage, entities: List, replyMarkup: InlineKeyboardMarkup? = null -): ContentMessage where T : CaptionedInput, T : MediaContent { +): ContentMessage where T : TextedInput, T : MediaContent { return editMessageCaption(message.chat.id, message.messageId, entities, replyMarkup) } diff --git a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendPhoto.kt b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendPhoto.kt index d4ee9ed59d..c641033456 100644 --- a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendPhoto.kt +++ b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendPhoto.kt @@ -16,7 +16,7 @@ import dev.inmo.tgbotapi.types.message.abstracts.Message suspend fun TelegramBot.sendPhoto( chatId: ChatIdentifier, fileId: InputFile, - caption: String? = null, + text: String? = null, parseMode: ParseMode? = null, disableNotification: Boolean = false, replyToMessageId: MessageIdentifier? = null, @@ -26,7 +26,7 @@ suspend fun TelegramBot.sendPhoto( SendPhoto( chatId, fileId, - caption, + text, parseMode, disableNotification, replyToMessageId, @@ -38,65 +38,65 @@ suspend fun TelegramBot.sendPhoto( suspend fun TelegramBot.sendPhoto( chat: Chat, fileId: InputFile, - caption: String? = null, + text: String? = null, parseMode: ParseMode? = null, disableNotification: Boolean = false, replyToMessageId: MessageIdentifier? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(chat.id, fileId, caption, parseMode, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendPhoto(chat.id, fileId, text, parseMode, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup) suspend fun TelegramBot.sendPhoto( chatId: ChatIdentifier, photo: Photo, - caption: String? = null, + text: String? = null, parseMode: ParseMode? = null, disableNotification: Boolean = false, replyToMessageId: MessageIdentifier? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(chatId, photo.biggest() ?.fileId ?: error("Photo content must not be empty"), caption, parseMode, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendPhoto(chatId, photo.biggest() ?.fileId ?: error("Photo content must not be empty"), text, parseMode, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup) suspend fun TelegramBot.sendPhoto( chat: Chat, photo: Photo, - caption: String? = null, + text: String? = null, parseMode: ParseMode? = null, disableNotification: Boolean = false, replyToMessageId: MessageIdentifier? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(chat.id, photo, caption, parseMode, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendPhoto(chat.id, photo, text, parseMode, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup) suspend inline fun TelegramBot.replyWithPhoto( to: Message, fileId: InputFile, - caption: String? = null, + text: String? = null, parseMode: ParseMode? = null, disableNotification: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(to.chat, fileId, caption, parseMode, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup) +) = sendPhoto(to.chat, fileId, text, parseMode, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup) suspend inline fun TelegramBot.replyWithPhoto( to: Message, photo: Photo, - caption: String? = null, + text: String? = null, parseMode: ParseMode? = null, disableNotification: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(to.chat, photo, caption, parseMode, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup) +) = sendPhoto(to.chat, photo, text, parseMode, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup) suspend inline fun TelegramBot.reply( to: Message, photo: Photo, - caption: String? = null, + text: String? = null, parseMode: ParseMode? = null, disableNotification: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = replyWithPhoto(to, photo, caption, parseMode, disableNotification, allowSendingWithoutReply, replyMarkup) +) = replyWithPhoto(to, photo, text, parseMode, disableNotification, allowSendingWithoutReply, replyMarkup) suspend inline fun TelegramBot.sendPhoto(