mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 16:23:48 +00:00
add support of sender_boost_count
This commit is contained in:
parent
468c54a30f
commit
a9a01e3154
@ -123,6 +123,7 @@ data class CommonGroupContentMessageImpl<T : MessageContent>(
|
|||||||
override val content: T,
|
override val content: T,
|
||||||
override val senderBot: CommonBot?,
|
override val senderBot: CommonBot?,
|
||||||
override val mediaGroupId: MediaGroupIdentifier?,
|
override val mediaGroupId: MediaGroupIdentifier?,
|
||||||
|
override val senderBoostsCount: Int?
|
||||||
) : CommonGroupContentMessage<T> {
|
) : CommonGroupContentMessage<T> {
|
||||||
constructor(
|
constructor(
|
||||||
chat: PreviewGroupChat,
|
chat: PreviewGroupChat,
|
||||||
@ -137,8 +138,9 @@ data class CommonGroupContentMessageImpl<T : MessageContent>(
|
|||||||
content: T,
|
content: T,
|
||||||
senderBot: CommonBot?,
|
senderBot: CommonBot?,
|
||||||
mediaGroupId: MediaGroupIdentifier?,
|
mediaGroupId: MediaGroupIdentifier?,
|
||||||
|
senderBoostsCount: Int?,
|
||||||
) : this(
|
) : this(
|
||||||
chat, messageId, from, date, forwardInfo.messageOrigin(), editDate, hasProtectedContent, replyTo ?.let { ReplyInfo.Internal(it) }, replyMarkup, content, senderBot, mediaGroupId
|
chat, messageId, from, date, forwardInfo.messageOrigin(), editDate, hasProtectedContent, replyTo ?.let { ReplyInfo.Internal(it) }, replyMarkup, content, senderBot, mediaGroupId, senderBoostsCount
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -226,6 +228,7 @@ data class CommonForumContentMessageImpl<T : MessageContent>(
|
|||||||
override val content: T,
|
override val content: T,
|
||||||
override val senderBot: CommonBot?,
|
override val senderBot: CommonBot?,
|
||||||
override val mediaGroupId: MediaGroupIdentifier?,
|
override val mediaGroupId: MediaGroupIdentifier?,
|
||||||
|
override val senderBoostsCount: Int?,
|
||||||
) : CommonForumContentMessage<T> {
|
) : CommonForumContentMessage<T> {
|
||||||
constructor(
|
constructor(
|
||||||
chat: PreviewForumChat,
|
chat: PreviewForumChat,
|
||||||
@ -241,7 +244,8 @@ data class CommonForumContentMessageImpl<T : MessageContent>(
|
|||||||
content: T,
|
content: T,
|
||||||
senderBot: CommonBot?,
|
senderBot: CommonBot?,
|
||||||
mediaGroupId: MediaGroupIdentifier?,
|
mediaGroupId: MediaGroupIdentifier?,
|
||||||
|
senderBoostsCount: Int?,
|
||||||
) : this(
|
) : this(
|
||||||
chat, messageId, threadId, from, date, forwardInfo.messageOrigin(), editDate, hasProtectedContent, replyTo ?.let { ReplyInfo.Internal(it) }, replyMarkup, content, senderBot, mediaGroupId
|
chat, messageId, threadId, from, date, forwardInfo.messageOrigin(), editDate, hasProtectedContent, replyTo ?.let { ReplyInfo.Internal(it) }, replyMarkup, content, senderBot, mediaGroupId, senderBoostsCount
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -98,6 +98,7 @@ internal data class RawMessage(
|
|||||||
private val successful_payment: SuccessfulPayment? = null,
|
private val successful_payment: SuccessfulPayment? = null,
|
||||||
private val giveaway: Giveaway? = null,
|
private val giveaway: Giveaway? = null,
|
||||||
private val giveaway_winners: GiveawayResults? = null,
|
private val giveaway_winners: GiveawayResults? = null,
|
||||||
|
private val sender_boost_count: Int? = null,
|
||||||
|
|
||||||
private val users_shared: UsersShared? = null,
|
private val users_shared: UsersShared? = null,
|
||||||
private val chat_shared: ChatShared? = null,
|
private val chat_shared: ChatShared? = null,
|
||||||
@ -371,7 +372,8 @@ internal data class RawMessage(
|
|||||||
reply_markup,
|
reply_markup,
|
||||||
content,
|
content,
|
||||||
via_bot,
|
via_bot,
|
||||||
media_group_id
|
media_group_id,
|
||||||
|
sender_boost_count
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -435,7 +437,8 @@ internal data class RawMessage(
|
|||||||
reply_markup,
|
reply_markup,
|
||||||
content,
|
content,
|
||||||
via_bot,
|
via_bot,
|
||||||
media_group_id
|
media_group_id,
|
||||||
|
sender_boost_count
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -499,7 +502,8 @@ internal data class RawMessage(
|
|||||||
reply_markup,
|
reply_markup,
|
||||||
content,
|
content,
|
||||||
via_bot,
|
via_bot,
|
||||||
media_group_id
|
media_group_id,
|
||||||
|
sender_boost_count
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,10 @@ sealed interface GroupContentMessage<T : MessageContent> : PublicContentMessage<
|
|||||||
override val chat: PreviewGroupChat
|
override val chat: PreviewGroupChat
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sealed interface PotentiallyFromUserGroupContentMessage<T : MessageContent> : GroupContentMessage<T> {
|
||||||
|
val senderBoostsCount: Int?
|
||||||
|
}
|
||||||
|
|
||||||
sealed interface ForumContentMessage<T : MessageContent> : GroupContentMessage<T>, PossiblyTopicMessage {
|
sealed interface ForumContentMessage<T : MessageContent> : GroupContentMessage<T>, PossiblyTopicMessage {
|
||||||
override val chat: PreviewForumChat
|
override val chat: PreviewForumChat
|
||||||
override val threadId: MessageThreadId
|
override val threadId: MessageThreadId
|
||||||
@ -28,7 +32,7 @@ interface AnonymousGroupContentMessage<T : MessageContent> : GroupContentMessage
|
|||||||
get() = chat
|
get() = chat
|
||||||
}
|
}
|
||||||
|
|
||||||
interface CommonGroupContentMessage<T : MessageContent> : GroupContentMessage<T>, FromUserMessage
|
interface CommonGroupContentMessage<T : MessageContent> : GroupContentMessage<T>, PotentiallyFromUserGroupContentMessage<T>, FromUserMessage
|
||||||
|
|
||||||
interface FromChannelForumContentMessage<T: MessageContent> : FromChannelGroupContentMessage<T>, ForumContentMessage<T>
|
interface FromChannelForumContentMessage<T: MessageContent> : FromChannelGroupContentMessage<T>, ForumContentMessage<T>
|
||||||
|
|
||||||
@ -37,4 +41,4 @@ interface AnonymousForumContentMessage<T : MessageContent> : ForumContentMessage
|
|||||||
get() = chat
|
get() = chat
|
||||||
}
|
}
|
||||||
|
|
||||||
interface CommonForumContentMessage<T : MessageContent> : ForumContentMessage<T>, FromUserMessage
|
interface CommonForumContentMessage<T : MessageContent> : ForumContentMessage<T>, PotentiallyFromUserGroupContentMessage<T>, FromUserMessage
|
||||||
|
@ -86,7 +86,8 @@ fun <T : MediaGroupPartContent> List<PossiblySentViaBotCommonMessage<T>>.asMedia
|
|||||||
sourceMessage.replyMarkup,
|
sourceMessage.replyMarkup,
|
||||||
content,
|
content,
|
||||||
sourceMessage.senderBot,
|
sourceMessage.senderBot,
|
||||||
sourceMessage.mediaGroupId
|
sourceMessage.mediaGroupId,
|
||||||
|
sourceMessage.senderBoostsCount
|
||||||
)
|
)
|
||||||
is ConnectedFromChannelGroupContentMessage -> ConnectedFromChannelGroupContentMessageImpl(
|
is ConnectedFromChannelGroupContentMessage -> ConnectedFromChannelGroupContentMessageImpl(
|
||||||
sourceMessage.chat,
|
sourceMessage.chat,
|
||||||
@ -146,7 +147,8 @@ fun <T : MediaGroupPartContent> List<PossiblySentViaBotCommonMessage<T>>.asMedia
|
|||||||
sourceMessage.replyMarkup,
|
sourceMessage.replyMarkup,
|
||||||
content,
|
content,
|
||||||
sourceMessage.senderBot,
|
sourceMessage.senderBot,
|
||||||
sourceMessage.mediaGroupId
|
sourceMessage.mediaGroupId,
|
||||||
|
sourceMessage.senderBoostsCount
|
||||||
)
|
)
|
||||||
is FromChannelForumContentMessage -> FromChannelForumContentMessageImpl(
|
is FromChannelForumContentMessage -> FromChannelForumContentMessageImpl(
|
||||||
sourceMessage.chat,
|
sourceMessage.chat,
|
||||||
|
@ -285,6 +285,7 @@ import dev.inmo.tgbotapi.types.message.abstracts.PossiblyMediaGroupMessage
|
|||||||
import dev.inmo.tgbotapi.types.message.abstracts.PossiblyPaymentMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.PossiblyPaymentMessage
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.PossiblySentViaBotCommonMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.PossiblySentViaBotCommonMessage
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.PossiblyTopicMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.PossiblyTopicMessage
|
||||||
|
import dev.inmo.tgbotapi.types.message.abstracts.PotentiallyFromUserGroupContentMessage
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.PrivateContentMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.PrivateContentMessage
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.PublicContentMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.PublicContentMessage
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.SignedMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.SignedMessage
|
||||||
@ -3397,6 +3398,18 @@ public inline fun <T>
|
|||||||
Message.ifGroupContentMessage(block: (GroupContentMessage<MessageContent>) -> T): T? =
|
Message.ifGroupContentMessage(block: (GroupContentMessage<MessageContent>) -> T): T? =
|
||||||
groupContentMessageOrNull() ?.let(block)
|
groupContentMessageOrNull() ?.let(block)
|
||||||
|
|
||||||
|
public inline fun Message.potentiallyFromUserGroupContentMessageOrNull():
|
||||||
|
PotentiallyFromUserGroupContentMessage<MessageContent>? = this as?
|
||||||
|
dev.inmo.tgbotapi.types.message.abstracts.PotentiallyFromUserGroupContentMessage<dev.inmo.tgbotapi.types.message.content.MessageContent>
|
||||||
|
|
||||||
|
public inline fun Message.potentiallyFromUserGroupContentMessageOrThrow():
|
||||||
|
PotentiallyFromUserGroupContentMessage<MessageContent> = this as
|
||||||
|
dev.inmo.tgbotapi.types.message.abstracts.PotentiallyFromUserGroupContentMessage<dev.inmo.tgbotapi.types.message.content.MessageContent>
|
||||||
|
|
||||||
|
public inline fun <T>
|
||||||
|
Message.ifPotentiallyFromUserGroupContentMessage(block: (PotentiallyFromUserGroupContentMessage<MessageContent>) -> T):
|
||||||
|
T? = potentiallyFromUserGroupContentMessageOrNull() ?.let(block)
|
||||||
|
|
||||||
public inline fun Message.forumContentMessageOrNull(): ForumContentMessage<MessageContent>? = this
|
public inline fun Message.forumContentMessageOrNull(): ForumContentMessage<MessageContent>? = this
|
||||||
as?
|
as?
|
||||||
dev.inmo.tgbotapi.types.message.abstracts.ForumContentMessage<dev.inmo.tgbotapi.types.message.content.MessageContent>
|
dev.inmo.tgbotapi.types.message.abstracts.ForumContentMessage<dev.inmo.tgbotapi.types.message.content.MessageContent>
|
||||||
|
Loading…
Reference in New Issue
Block a user