diff --git a/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/AnimationContent.kt b/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/AnimationContent.kt index 6c67d897a3..228dc65d47 100644 --- a/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/AnimationContent.kt +++ b/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/AnimationContent.kt @@ -45,7 +45,7 @@ data class AnimationContent( override fun asInputMedia(): InputMediaAnimation = InputMediaAnimation( media.fileId, - toMarkdownV2Captions().first(), + toMarkdownV2Captions().firstOrNull(), MarkdownV2, media.width, media.height, diff --git a/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/AudioContent.kt b/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/AudioContent.kt index 35e47a691b..0688a5f1cb 100644 --- a/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/AudioContent.kt +++ b/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/AudioContent.kt @@ -44,7 +44,7 @@ data class AudioContent( override fun asInputMedia(): InputMediaAudio = InputMediaAudio( media.fileId, - toMarkdownV2Captions().first(), + toMarkdownV2Captions().firstOrNull(), MarkdownV2, media.duration, media.performer, diff --git a/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/DocumentContent.kt b/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/DocumentContent.kt index 2b7b196828..8125fa789b 100644 --- a/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/DocumentContent.kt +++ b/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/DocumentContent.kt @@ -41,7 +41,7 @@ data class DocumentContent( override fun asInputMedia(): InputMediaDocument = InputMediaDocument( media.fileId, - toMarkdownV2Captions().first(), + toMarkdownV2Captions().firstOrNull(), MarkdownV2, media.thumb ?.fileId ) diff --git a/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/PhotoContent.kt b/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/PhotoContent.kt index c8cbd20969..a41d41e4d5 100644 --- a/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/PhotoContent.kt +++ b/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/PhotoContent.kt @@ -48,7 +48,7 @@ data class PhotoContent( override fun asInputMedia(): InputMediaPhoto = InputMediaPhoto( media.fileId, - toMarkdownV2Captions().first(), + toMarkdownV2Captions().firstOrNull(), MarkdownV2 ) } diff --git a/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/VideoContent.kt b/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/VideoContent.kt index f7ca32c856..0e0ff2dc29 100644 --- a/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/VideoContent.kt +++ b/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/VideoContent.kt @@ -53,7 +53,7 @@ data class VideoContent( override fun asInputMedia(): InputMediaVideo = InputMediaVideo( media.fileId, - toMarkdownV2Captions().first(), + toMarkdownV2Captions().firstOrNull(), MarkdownV2, media.width, media.height, diff --git a/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/VoiceContent.kt b/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/VoiceContent.kt index 26b8fa523f..0e10dbeeec 100644 --- a/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/VoiceContent.kt +++ b/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/VoiceContent.kt @@ -42,7 +42,7 @@ data class VoiceContent( override fun asInputMedia(): InputMediaAudio = InputMediaAudio( media.fileId, - toMarkdownV2Captions().first(), + toMarkdownV2Captions().firstOrNull(), MarkdownV2, media.duration )