diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/RawMessage.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/RawMessage.kt index 6a5d7f2c6a..2a4feb665b 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/RawMessage.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/RawMessage.kt @@ -137,7 +137,7 @@ internal data class RawMessage( when { story != null -> StoryContent( - from ?: error("For story content field 'from' is required and should contains User info"), + chat, messageId, story ) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/StoryContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/StoryContent.kt index 201de4cbec..48e85ade62 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/StoryContent.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/StoryContent.kt @@ -13,7 +13,7 @@ import kotlinx.serialization.Serializable @Serializable data class StoryContent( - private val from: Chat, + private val chat: Chat, private val messageId: MessageId, val story: Story ) : MessageContent { @@ -27,7 +27,7 @@ data class StoryContent( replyMarkup: KeyboardMarkup? ): Request { return ForwardMessage( - from.id, + chat.id, toChatId = chatId, messageId = messageId, threadId = messageThreadId,