mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-12-23 00:57:13 +00:00
fix of core build
This commit is contained in:
parent
8de41bdd99
commit
211cef298c
File diff suppressed because it is too large
Load Diff
@ -16,165 +16,165 @@ fun <T : MediaGroupPartContent> List<PossiblySentViaBotCommonMessage<T>>.asMedia
|
||||
)
|
||||
return when (sourceMessage) {
|
||||
is ChannelContentMessage -> ChannelContentMessageImpl(
|
||||
sourceMessage.messageId,
|
||||
sourceMessage.chat,
|
||||
content,
|
||||
sourceMessage.date,
|
||||
sourceMessage.editDate,
|
||||
sourceMessage.hasProtectedContent,
|
||||
sourceMessage.forwardOrigin,
|
||||
sourceMessage.replyInfo,
|
||||
sourceMessage.replyMarkup,
|
||||
sourceMessage.senderBot,
|
||||
sourceMessage.authorSignature,
|
||||
sourceMessage.mediaGroupId,
|
||||
sourceMessage.fromOffline
|
||||
messageId = sourceMessage.messageId,
|
||||
chat = sourceMessage.chat,
|
||||
content = content,
|
||||
date = sourceMessage.date,
|
||||
editDate = sourceMessage.editDate,
|
||||
hasProtectedContent = sourceMessage.hasProtectedContent,
|
||||
forwardOrigin = sourceMessage.forwardOrigin,
|
||||
replyInfo = sourceMessage.replyInfo,
|
||||
replyMarkup = sourceMessage.replyMarkup,
|
||||
senderBot = sourceMessage.senderBot,
|
||||
authorSignature = sourceMessage.authorSignature,
|
||||
mediaGroupId = sourceMessage.mediaGroupId,
|
||||
fromOffline = sourceMessage.fromOffline
|
||||
)
|
||||
is BusinessContentMessage -> BusinessContentMessageImpl(
|
||||
sourceMessage.messageId,
|
||||
sourceMessage.user,
|
||||
sourceMessage.chat,
|
||||
sourceMessage.businessConnectionId,
|
||||
content,
|
||||
sourceMessage.date,
|
||||
sourceMessage.editDate,
|
||||
sourceMessage.hasProtectedContent,
|
||||
sourceMessage.forwardOrigin,
|
||||
sourceMessage.replyInfo,
|
||||
sourceMessage.replyMarkup,
|
||||
sourceMessage.senderBot,
|
||||
sourceMessage.mediaGroupId,
|
||||
sourceMessage.senderBusinessBot,
|
||||
sourceMessage.fromOffline
|
||||
messageId = sourceMessage.messageId,
|
||||
from = sourceMessage.user,
|
||||
chat = sourceMessage.chat,
|
||||
businessConnectionId = sourceMessage.businessConnectionId,
|
||||
content = content,
|
||||
date = sourceMessage.date,
|
||||
editDate = sourceMessage.editDate,
|
||||
hasProtectedContent = sourceMessage.hasProtectedContent,
|
||||
forwardOrigin = sourceMessage.forwardOrigin,
|
||||
replyInfo = sourceMessage.replyInfo,
|
||||
replyMarkup = sourceMessage.replyMarkup,
|
||||
senderBot = sourceMessage.senderBot,
|
||||
mediaGroupId = sourceMessage.mediaGroupId,
|
||||
senderBusinessBot = sourceMessage.senderBusinessBot,
|
||||
fromOffline = sourceMessage.fromOffline
|
||||
)
|
||||
is PrivateContentMessage -> PrivateContentMessageImpl(
|
||||
sourceMessage.messageId,
|
||||
sourceMessage.user,
|
||||
sourceMessage.chat,
|
||||
content,
|
||||
sourceMessage.date,
|
||||
sourceMessage.editDate,
|
||||
sourceMessage.hasProtectedContent,
|
||||
sourceMessage.forwardOrigin,
|
||||
sourceMessage.replyInfo,
|
||||
sourceMessage.replyMarkup,
|
||||
sourceMessage.senderBot,
|
||||
sourceMessage.mediaGroupId,
|
||||
sourceMessage.fromOffline,
|
||||
sourceMessage.effectId
|
||||
messageId = sourceMessage.messageId,
|
||||
from = sourceMessage.user,
|
||||
chat = sourceMessage.chat,
|
||||
content = content,
|
||||
date = sourceMessage.date,
|
||||
editDate = sourceMessage.editDate,
|
||||
hasProtectedContent = sourceMessage.hasProtectedContent,
|
||||
forwardOrigin = sourceMessage.forwardOrigin,
|
||||
replyInfo = sourceMessage.replyInfo,
|
||||
replyMarkup = sourceMessage.replyMarkup,
|
||||
senderBot = sourceMessage.senderBot,
|
||||
mediaGroupId = sourceMessage.mediaGroupId,
|
||||
fromOffline = sourceMessage.fromOffline,
|
||||
effectId = sourceMessage.effectId
|
||||
)
|
||||
is AnonymousGroupContentMessage -> AnonymousGroupContentMessageImpl(
|
||||
sourceMessage.chat,
|
||||
sourceMessage.messageId,
|
||||
sourceMessage.date,
|
||||
sourceMessage.forwardOrigin,
|
||||
sourceMessage.editDate,
|
||||
sourceMessage.hasProtectedContent,
|
||||
sourceMessage.replyInfo,
|
||||
sourceMessage.replyMarkup,
|
||||
content,
|
||||
sourceMessage.senderBot,
|
||||
sourceMessage.authorSignature,
|
||||
sourceMessage.mediaGroupId,
|
||||
sourceMessage.fromOffline
|
||||
chat = sourceMessage.chat,
|
||||
messageId = sourceMessage.messageId,
|
||||
date = sourceMessage.date,
|
||||
forwardOrigin = sourceMessage.forwardOrigin,
|
||||
editDate = sourceMessage.editDate,
|
||||
hasProtectedContent = sourceMessage.hasProtectedContent,
|
||||
replyInfo = sourceMessage.replyInfo,
|
||||
replyMarkup = sourceMessage.replyMarkup,
|
||||
content = content,
|
||||
senderBot = sourceMessage.senderBot,
|
||||
authorSignature = sourceMessage.authorSignature,
|
||||
mediaGroupId = sourceMessage.mediaGroupId,
|
||||
fromOffline = sourceMessage.fromOffline
|
||||
)
|
||||
is CommonGroupContentMessage -> CommonGroupContentMessageImpl(
|
||||
sourceMessage.chat,
|
||||
sourceMessage.messageId,
|
||||
sourceMessage.user,
|
||||
sourceMessage.date,
|
||||
sourceMessage.forwardOrigin,
|
||||
sourceMessage.editDate,
|
||||
sourceMessage.hasProtectedContent,
|
||||
sourceMessage.replyInfo,
|
||||
sourceMessage.replyMarkup,
|
||||
content,
|
||||
sourceMessage.senderBot,
|
||||
sourceMessage.mediaGroupId,
|
||||
sourceMessage.senderBoostsCount,
|
||||
sourceMessage.fromOffline
|
||||
chat = sourceMessage.chat,
|
||||
messageId = sourceMessage.messageId,
|
||||
from = sourceMessage.user,
|
||||
date = sourceMessage.date,
|
||||
forwardOrigin = sourceMessage.forwardOrigin,
|
||||
editDate = sourceMessage.editDate,
|
||||
hasProtectedContent = sourceMessage.hasProtectedContent,
|
||||
replyInfo = sourceMessage.replyInfo,
|
||||
replyMarkup = sourceMessage.replyMarkup,
|
||||
content = content,
|
||||
senderBot = sourceMessage.senderBot,
|
||||
mediaGroupId = sourceMessage.mediaGroupId,
|
||||
senderBoostsCount = sourceMessage.senderBoostsCount,
|
||||
fromOffline = sourceMessage.fromOffline
|
||||
)
|
||||
is ConnectedFromChannelGroupContentMessage -> ConnectedFromChannelGroupContentMessageImpl(
|
||||
sourceMessage.chat,
|
||||
sourceMessage.channel,
|
||||
sourceMessage.messageId,
|
||||
sourceMessage.date,
|
||||
sourceMessage.forwardOrigin,
|
||||
sourceMessage.editDate,
|
||||
sourceMessage.hasProtectedContent,
|
||||
sourceMessage.replyInfo,
|
||||
sourceMessage.replyMarkup,
|
||||
content,
|
||||
sourceMessage.senderBot,
|
||||
sourceMessage.authorSignature,
|
||||
sourceMessage.mediaGroupId,
|
||||
sourceMessage.fromOffline
|
||||
chat = sourceMessage.chat,
|
||||
channel = sourceMessage.channel,
|
||||
messageId = sourceMessage.messageId,
|
||||
date = sourceMessage.date,
|
||||
forwardOrigin = sourceMessage.forwardOrigin,
|
||||
editDate = sourceMessage.editDate,
|
||||
hasProtectedContent = sourceMessage.hasProtectedContent,
|
||||
replyInfo = sourceMessage.replyInfo,
|
||||
replyMarkup = sourceMessage.replyMarkup,
|
||||
content = content,
|
||||
senderBot = sourceMessage.senderBot,
|
||||
authorSignature = sourceMessage.authorSignature,
|
||||
mediaGroupId = sourceMessage.mediaGroupId,
|
||||
fromOffline = sourceMessage.fromOffline
|
||||
)
|
||||
is UnconnectedFromChannelGroupContentMessage -> UnconnectedFromChannelGroupContentMessageImpl(
|
||||
sourceMessage.chat,
|
||||
sourceMessage.channel,
|
||||
sourceMessage.messageId,
|
||||
sourceMessage.date,
|
||||
sourceMessage.forwardOrigin,
|
||||
sourceMessage.editDate,
|
||||
sourceMessage.hasProtectedContent,
|
||||
sourceMessage.replyInfo,
|
||||
sourceMessage.replyMarkup,
|
||||
content,
|
||||
sourceMessage.senderBot,
|
||||
sourceMessage.authorSignature,
|
||||
sourceMessage.mediaGroupId,
|
||||
sourceMessage.fromOffline
|
||||
chat = sourceMessage.chat,
|
||||
channel = sourceMessage.channel,
|
||||
messageId = sourceMessage.messageId,
|
||||
date = sourceMessage.date,
|
||||
forwardOrigin = sourceMessage.forwardOrigin,
|
||||
editDate = sourceMessage.editDate,
|
||||
hasProtectedContent = sourceMessage.hasProtectedContent,
|
||||
replyInfo = sourceMessage.replyInfo,
|
||||
replyMarkup = sourceMessage.replyMarkup,
|
||||
content = content,
|
||||
senderBot = sourceMessage.senderBot,
|
||||
authorSignature = sourceMessage.authorSignature,
|
||||
mediaGroupId = sourceMessage.mediaGroupId,
|
||||
fromOffline = sourceMessage.fromOffline
|
||||
)
|
||||
is AnonymousForumContentMessage -> AnonymousForumContentMessageImpl(
|
||||
sourceMessage.chat,
|
||||
sourceMessage.messageId,
|
||||
sourceMessage.threadId,
|
||||
sourceMessage.date,
|
||||
sourceMessage.forwardOrigin,
|
||||
sourceMessage.editDate,
|
||||
sourceMessage.hasProtectedContent,
|
||||
sourceMessage.replyInfo,
|
||||
sourceMessage.replyMarkup,
|
||||
content,
|
||||
sourceMessage.senderBot,
|
||||
sourceMessage.authorSignature,
|
||||
sourceMessage.mediaGroupId,
|
||||
sourceMessage.fromOffline
|
||||
chat = sourceMessage.chat,
|
||||
messageId = sourceMessage.messageId,
|
||||
threadId = sourceMessage.threadId,
|
||||
date = sourceMessage.date,
|
||||
forwardOrigin = sourceMessage.forwardOrigin,
|
||||
editDate = sourceMessage.editDate,
|
||||
hasProtectedContent = sourceMessage.hasProtectedContent,
|
||||
replyInfo = sourceMessage.replyInfo,
|
||||
replyMarkup = sourceMessage.replyMarkup,
|
||||
content = content,
|
||||
senderBot = sourceMessage.senderBot,
|
||||
authorSignature = sourceMessage.authorSignature,
|
||||
mediaGroupId = sourceMessage.mediaGroupId,
|
||||
fromOffline = sourceMessage.fromOffline
|
||||
)
|
||||
is CommonForumContentMessage -> CommonForumContentMessageImpl(
|
||||
sourceMessage.chat,
|
||||
sourceMessage.messageId,
|
||||
sourceMessage.threadId,
|
||||
sourceMessage.user,
|
||||
sourceMessage.date,
|
||||
sourceMessage.forwardOrigin,
|
||||
sourceMessage.editDate,
|
||||
sourceMessage.hasProtectedContent,
|
||||
sourceMessage.replyInfo,
|
||||
sourceMessage.replyMarkup,
|
||||
content,
|
||||
sourceMessage.senderBot,
|
||||
sourceMessage.mediaGroupId,
|
||||
sourceMessage.senderBoostsCount,
|
||||
sourceMessage.fromOffline
|
||||
chat = sourceMessage.chat,
|
||||
messageId = sourceMessage.messageId,
|
||||
threadId = sourceMessage.threadId,
|
||||
from = sourceMessage.user,
|
||||
date = sourceMessage.date,
|
||||
forwardOrigin = sourceMessage.forwardOrigin,
|
||||
editDate = sourceMessage.editDate,
|
||||
hasProtectedContent = sourceMessage.hasProtectedContent,
|
||||
replyInfo = sourceMessage.replyInfo,
|
||||
replyMarkup = sourceMessage.replyMarkup,
|
||||
content = content,
|
||||
senderBot = sourceMessage.senderBot,
|
||||
mediaGroupId = sourceMessage.mediaGroupId,
|
||||
senderBoostsCount = sourceMessage.senderBoostsCount,
|
||||
fromOffline = sourceMessage.fromOffline
|
||||
)
|
||||
is FromChannelForumContentMessage -> FromChannelForumContentMessageImpl(
|
||||
sourceMessage.chat,
|
||||
sourceMessage.channel,
|
||||
sourceMessage.messageId,
|
||||
sourceMessage.threadId,
|
||||
sourceMessage.date,
|
||||
sourceMessage.forwardOrigin,
|
||||
sourceMessage.editDate,
|
||||
sourceMessage.hasProtectedContent,
|
||||
sourceMessage.replyInfo,
|
||||
sourceMessage.replyMarkup,
|
||||
content,
|
||||
sourceMessage.senderBot,
|
||||
sourceMessage.authorSignature,
|
||||
sourceMessage.mediaGroupId,
|
||||
sourceMessage.fromOffline
|
||||
chat = sourceMessage.chat,
|
||||
channel = sourceMessage.channel,
|
||||
messageId = sourceMessage.messageId,
|
||||
threadId = sourceMessage.threadId,
|
||||
date = sourceMessage.date,
|
||||
forwardOrigin = sourceMessage.forwardOrigin,
|
||||
editDate = sourceMessage.editDate,
|
||||
hasProtectedContent = sourceMessage.hasProtectedContent,
|
||||
replyInfo = sourceMessage.replyInfo,
|
||||
replyMarkup = sourceMessage.replyMarkup,
|
||||
content = content,
|
||||
senderBot = sourceMessage.senderBot,
|
||||
authorSignature = sourceMessage.authorSignature,
|
||||
mediaGroupId = sourceMessage.mediaGroupId,
|
||||
fromOffline = sourceMessage.fromOffline
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -59,8 +59,8 @@ internal val testTextEntities = listOf(
|
||||
),
|
||||
RawMessageEntity(
|
||||
"expandable_blockquote",
|
||||
120,
|
||||
204
|
||||
197,
|
||||
86
|
||||
)
|
||||
)
|
||||
|
||||
@ -75,6 +75,8 @@ fun TextSourcesList.testTextSources() {
|
||||
assertTrue (get(7) is MentionTextSource)
|
||||
assertTrue (get(8) is RegularTextSource)
|
||||
assertTrue (get(9) is BlockquoteTextSource)
|
||||
assertTrue (get(10) is RegularTextSource)
|
||||
assertTrue (get(11) is ExpandableBlockquoteTextSource)
|
||||
|
||||
val boldSource = get(1) as BoldTextSource
|
||||
assertTrue (boldSource.subsources.first() is ItalicTextSource)
|
||||
@ -85,5 +87,8 @@ fun TextSourcesList.testTextSources() {
|
||||
val blockquoteSource = get(9) as BlockquoteTextSource
|
||||
assertTrue (blockquoteSource.subsources.first() is RegularTextSource)
|
||||
|
||||
val expandableBlockquoteSource = get(11) as ExpandableBlockquoteTextSource
|
||||
assertTrue (expandableBlockquoteSource.subsources.first() is RegularTextSource)
|
||||
|
||||
assertEquals(this, toRawMessageEntities().asTextSources(makeSourceString()))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user