1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-12-23 09:07:12 +00:00

fix of core build

This commit is contained in:
InsanusMokrassar 2024-05-31 12:39:12 +06:00
parent 8de41bdd99
commit 211cef298c
3 changed files with 833 additions and 563 deletions

File diff suppressed because it is too large Load Diff

View File

@ -16,165 +16,165 @@ fun <T : MediaGroupPartContent> List<PossiblySentViaBotCommonMessage<T>>.asMedia
) )
return when (sourceMessage) { return when (sourceMessage) {
is ChannelContentMessage -> ChannelContentMessageImpl( is ChannelContentMessage -> ChannelContentMessageImpl(
sourceMessage.messageId, messageId = sourceMessage.messageId,
sourceMessage.chat, chat = sourceMessage.chat,
content, content = content,
sourceMessage.date, date = sourceMessage.date,
sourceMessage.editDate, editDate = sourceMessage.editDate,
sourceMessage.hasProtectedContent, hasProtectedContent = sourceMessage.hasProtectedContent,
sourceMessage.forwardOrigin, forwardOrigin = sourceMessage.forwardOrigin,
sourceMessage.replyInfo, replyInfo = sourceMessage.replyInfo,
sourceMessage.replyMarkup, replyMarkup = sourceMessage.replyMarkup,
sourceMessage.senderBot, senderBot = sourceMessage.senderBot,
sourceMessage.authorSignature, authorSignature = sourceMessage.authorSignature,
sourceMessage.mediaGroupId, mediaGroupId = sourceMessage.mediaGroupId,
sourceMessage.fromOffline fromOffline = sourceMessage.fromOffline
) )
is BusinessContentMessage -> BusinessContentMessageImpl( is BusinessContentMessage -> BusinessContentMessageImpl(
sourceMessage.messageId, messageId = sourceMessage.messageId,
sourceMessage.user, from = sourceMessage.user,
sourceMessage.chat, chat = sourceMessage.chat,
sourceMessage.businessConnectionId, businessConnectionId = sourceMessage.businessConnectionId,
content, content = content,
sourceMessage.date, date = sourceMessage.date,
sourceMessage.editDate, editDate = sourceMessage.editDate,
sourceMessage.hasProtectedContent, hasProtectedContent = sourceMessage.hasProtectedContent,
sourceMessage.forwardOrigin, forwardOrigin = sourceMessage.forwardOrigin,
sourceMessage.replyInfo, replyInfo = sourceMessage.replyInfo,
sourceMessage.replyMarkup, replyMarkup = sourceMessage.replyMarkup,
sourceMessage.senderBot, senderBot = sourceMessage.senderBot,
sourceMessage.mediaGroupId, mediaGroupId = sourceMessage.mediaGroupId,
sourceMessage.senderBusinessBot, senderBusinessBot = sourceMessage.senderBusinessBot,
sourceMessage.fromOffline fromOffline = sourceMessage.fromOffline
) )
is PrivateContentMessage -> PrivateContentMessageImpl( is PrivateContentMessage -> PrivateContentMessageImpl(
sourceMessage.messageId, messageId = sourceMessage.messageId,
sourceMessage.user, from = sourceMessage.user,
sourceMessage.chat, chat = sourceMessage.chat,
content, content = content,
sourceMessage.date, date = sourceMessage.date,
sourceMessage.editDate, editDate = sourceMessage.editDate,
sourceMessage.hasProtectedContent, hasProtectedContent = sourceMessage.hasProtectedContent,
sourceMessage.forwardOrigin, forwardOrigin = sourceMessage.forwardOrigin,
sourceMessage.replyInfo, replyInfo = sourceMessage.replyInfo,
sourceMessage.replyMarkup, replyMarkup = sourceMessage.replyMarkup,
sourceMessage.senderBot, senderBot = sourceMessage.senderBot,
sourceMessage.mediaGroupId, mediaGroupId = sourceMessage.mediaGroupId,
sourceMessage.fromOffline, fromOffline = sourceMessage.fromOffline,
sourceMessage.effectId effectId = sourceMessage.effectId
) )
is AnonymousGroupContentMessage -> AnonymousGroupContentMessageImpl( is AnonymousGroupContentMessage -> AnonymousGroupContentMessageImpl(
sourceMessage.chat, chat = sourceMessage.chat,
sourceMessage.messageId, messageId = sourceMessage.messageId,
sourceMessage.date, date = sourceMessage.date,
sourceMessage.forwardOrigin, forwardOrigin = sourceMessage.forwardOrigin,
sourceMessage.editDate, editDate = sourceMessage.editDate,
sourceMessage.hasProtectedContent, hasProtectedContent = sourceMessage.hasProtectedContent,
sourceMessage.replyInfo, replyInfo = sourceMessage.replyInfo,
sourceMessage.replyMarkup, replyMarkup = sourceMessage.replyMarkup,
content, content = content,
sourceMessage.senderBot, senderBot = sourceMessage.senderBot,
sourceMessage.authorSignature, authorSignature = sourceMessage.authorSignature,
sourceMessage.mediaGroupId, mediaGroupId = sourceMessage.mediaGroupId,
sourceMessage.fromOffline fromOffline = sourceMessage.fromOffline
) )
is CommonGroupContentMessage -> CommonGroupContentMessageImpl( is CommonGroupContentMessage -> CommonGroupContentMessageImpl(
sourceMessage.chat, chat = sourceMessage.chat,
sourceMessage.messageId, messageId = sourceMessage.messageId,
sourceMessage.user, from = sourceMessage.user,
sourceMessage.date, date = sourceMessage.date,
sourceMessage.forwardOrigin, forwardOrigin = sourceMessage.forwardOrigin,
sourceMessage.editDate, editDate = sourceMessage.editDate,
sourceMessage.hasProtectedContent, hasProtectedContent = sourceMessage.hasProtectedContent,
sourceMessage.replyInfo, replyInfo = sourceMessage.replyInfo,
sourceMessage.replyMarkup, replyMarkup = sourceMessage.replyMarkup,
content, content = content,
sourceMessage.senderBot, senderBot = sourceMessage.senderBot,
sourceMessage.mediaGroupId, mediaGroupId = sourceMessage.mediaGroupId,
sourceMessage.senderBoostsCount, senderBoostsCount = sourceMessage.senderBoostsCount,
sourceMessage.fromOffline fromOffline = sourceMessage.fromOffline
) )
is ConnectedFromChannelGroupContentMessage -> ConnectedFromChannelGroupContentMessageImpl( is ConnectedFromChannelGroupContentMessage -> ConnectedFromChannelGroupContentMessageImpl(
sourceMessage.chat, chat = sourceMessage.chat,
sourceMessage.channel, channel = sourceMessage.channel,
sourceMessage.messageId, messageId = sourceMessage.messageId,
sourceMessage.date, date = sourceMessage.date,
sourceMessage.forwardOrigin, forwardOrigin = sourceMessage.forwardOrigin,
sourceMessage.editDate, editDate = sourceMessage.editDate,
sourceMessage.hasProtectedContent, hasProtectedContent = sourceMessage.hasProtectedContent,
sourceMessage.replyInfo, replyInfo = sourceMessage.replyInfo,
sourceMessage.replyMarkup, replyMarkup = sourceMessage.replyMarkup,
content, content = content,
sourceMessage.senderBot, senderBot = sourceMessage.senderBot,
sourceMessage.authorSignature, authorSignature = sourceMessage.authorSignature,
sourceMessage.mediaGroupId, mediaGroupId = sourceMessage.mediaGroupId,
sourceMessage.fromOffline fromOffline = sourceMessage.fromOffline
) )
is UnconnectedFromChannelGroupContentMessage -> UnconnectedFromChannelGroupContentMessageImpl( is UnconnectedFromChannelGroupContentMessage -> UnconnectedFromChannelGroupContentMessageImpl(
sourceMessage.chat, chat = sourceMessage.chat,
sourceMessage.channel, channel = sourceMessage.channel,
sourceMessage.messageId, messageId = sourceMessage.messageId,
sourceMessage.date, date = sourceMessage.date,
sourceMessage.forwardOrigin, forwardOrigin = sourceMessage.forwardOrigin,
sourceMessage.editDate, editDate = sourceMessage.editDate,
sourceMessage.hasProtectedContent, hasProtectedContent = sourceMessage.hasProtectedContent,
sourceMessage.replyInfo, replyInfo = sourceMessage.replyInfo,
sourceMessage.replyMarkup, replyMarkup = sourceMessage.replyMarkup,
content, content = content,
sourceMessage.senderBot, senderBot = sourceMessage.senderBot,
sourceMessage.authorSignature, authorSignature = sourceMessage.authorSignature,
sourceMessage.mediaGroupId, mediaGroupId = sourceMessage.mediaGroupId,
sourceMessage.fromOffline fromOffline = sourceMessage.fromOffline
) )
is AnonymousForumContentMessage -> AnonymousForumContentMessageImpl( is AnonymousForumContentMessage -> AnonymousForumContentMessageImpl(
sourceMessage.chat, chat = sourceMessage.chat,
sourceMessage.messageId, messageId = sourceMessage.messageId,
sourceMessage.threadId, threadId = sourceMessage.threadId,
sourceMessage.date, date = sourceMessage.date,
sourceMessage.forwardOrigin, forwardOrigin = sourceMessage.forwardOrigin,
sourceMessage.editDate, editDate = sourceMessage.editDate,
sourceMessage.hasProtectedContent, hasProtectedContent = sourceMessage.hasProtectedContent,
sourceMessage.replyInfo, replyInfo = sourceMessage.replyInfo,
sourceMessage.replyMarkup, replyMarkup = sourceMessage.replyMarkup,
content, content = content,
sourceMessage.senderBot, senderBot = sourceMessage.senderBot,
sourceMessage.authorSignature, authorSignature = sourceMessage.authorSignature,
sourceMessage.mediaGroupId, mediaGroupId = sourceMessage.mediaGroupId,
sourceMessage.fromOffline fromOffline = sourceMessage.fromOffline
) )
is CommonForumContentMessage -> CommonForumContentMessageImpl( is CommonForumContentMessage -> CommonForumContentMessageImpl(
sourceMessage.chat, chat = sourceMessage.chat,
sourceMessage.messageId, messageId = sourceMessage.messageId,
sourceMessage.threadId, threadId = sourceMessage.threadId,
sourceMessage.user, from = sourceMessage.user,
sourceMessage.date, date = sourceMessage.date,
sourceMessage.forwardOrigin, forwardOrigin = sourceMessage.forwardOrigin,
sourceMessage.editDate, editDate = sourceMessage.editDate,
sourceMessage.hasProtectedContent, hasProtectedContent = sourceMessage.hasProtectedContent,
sourceMessage.replyInfo, replyInfo = sourceMessage.replyInfo,
sourceMessage.replyMarkup, replyMarkup = sourceMessage.replyMarkup,
content, content = content,
sourceMessage.senderBot, senderBot = sourceMessage.senderBot,
sourceMessage.mediaGroupId, mediaGroupId = sourceMessage.mediaGroupId,
sourceMessage.senderBoostsCount, senderBoostsCount = sourceMessage.senderBoostsCount,
sourceMessage.fromOffline fromOffline = sourceMessage.fromOffline
) )
is FromChannelForumContentMessage -> FromChannelForumContentMessageImpl( is FromChannelForumContentMessage -> FromChannelForumContentMessageImpl(
sourceMessage.chat, chat = sourceMessage.chat,
sourceMessage.channel, channel = sourceMessage.channel,
sourceMessage.messageId, messageId = sourceMessage.messageId,
sourceMessage.threadId, threadId = sourceMessage.threadId,
sourceMessage.date, date = sourceMessage.date,
sourceMessage.forwardOrigin, forwardOrigin = sourceMessage.forwardOrigin,
sourceMessage.editDate, editDate = sourceMessage.editDate,
sourceMessage.hasProtectedContent, hasProtectedContent = sourceMessage.hasProtectedContent,
sourceMessage.replyInfo, replyInfo = sourceMessage.replyInfo,
sourceMessage.replyMarkup, replyMarkup = sourceMessage.replyMarkup,
content, content = content,
sourceMessage.senderBot, senderBot = sourceMessage.senderBot,
sourceMessage.authorSignature, authorSignature = sourceMessage.authorSignature,
sourceMessage.mediaGroupId, mediaGroupId = sourceMessage.mediaGroupId,
sourceMessage.fromOffline fromOffline = sourceMessage.fromOffline
) )
} }
} }

View File

@ -59,8 +59,8 @@ internal val testTextEntities = listOf(
), ),
RawMessageEntity( RawMessageEntity(
"expandable_blockquote", "expandable_blockquote",
120, 197,
204 86
) )
) )
@ -75,6 +75,8 @@ fun TextSourcesList.testTextSources() {
assertTrue (get(7) is MentionTextSource) assertTrue (get(7) is MentionTextSource)
assertTrue (get(8) is RegularTextSource) assertTrue (get(8) is RegularTextSource)
assertTrue (get(9) is BlockquoteTextSource) assertTrue (get(9) is BlockquoteTextSource)
assertTrue (get(10) is RegularTextSource)
assertTrue (get(11) is ExpandableBlockquoteTextSource)
val boldSource = get(1) as BoldTextSource val boldSource = get(1) as BoldTextSource
assertTrue (boldSource.subsources.first() is ItalicTextSource) assertTrue (boldSource.subsources.first() is ItalicTextSource)
@ -85,5 +87,8 @@ fun TextSourcesList.testTextSources() {
val blockquoteSource = get(9) as BlockquoteTextSource val blockquoteSource = get(9) as BlockquoteTextSource
assertTrue (blockquoteSource.subsources.first() is RegularTextSource) assertTrue (blockquoteSource.subsources.first() is RegularTextSource)
val expandableBlockquoteSource = get(11) as ExpandableBlockquoteTextSource
assertTrue (expandableBlockquoteSource.subsources.first() is RegularTextSource)
assertEquals(this, toRawMessageEntities().asTextSources(makeSourceString())) assertEquals(this, toRawMessageEntities().asTextSources(makeSourceString()))
} }