1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2026-08-17 14:46:46 +00:00

fix of Replyparameters calls

This commit is contained in:
2026-08-14 20:16:47 +06:00
parent 4f19cb7626
commit 8b0e0bf820
9 changed files with 339 additions and 212 deletions

View File

@@ -15319,27 +15319,9 @@ public abstract interface class dev/inmo/tgbotapi/types/ReplyParameters {
public abstract fun getMessageId-CigXjpw ()Ldev/inmo/tgbotapi/types/MessageId;
}
public final class dev/inmo/tgbotapi/types/ReplyParameters$Chat : dev/inmo/tgbotapi/abstracts/TextedInput, dev/inmo/tgbotapi/types/ReplyParameters {
public final class dev/inmo/tgbotapi/types/ReplyParameters$Chat : dev/inmo/tgbotapi/abstracts/TextedInput, dev/inmo/tgbotapi/abstracts/WithMessageId, dev/inmo/tgbotapi/types/ReplyParameters {
public static final field Companion Ldev/inmo/tgbotapi/types/ReplyParameters$Chat$Companion;
public synthetic fun <init> (Ldev/inmo/tgbotapi/types/ChatIdentifier;JLjava/lang/Boolean;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun <init> (Ldev/inmo/tgbotapi/types/ChatIdentifier;JLjava/lang/Boolean;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun <init> (Ldev/inmo/tgbotapi/types/ChatIdentifier;JLjava/lang/Boolean;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/util/List;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun <init> (Ldev/inmo/tgbotapi/types/ChatIdentifier;JLjava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/lang/Boolean;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun <init> (Ldev/inmo/tgbotapi/types/ChatIdentifier;JLjava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/lang/Boolean;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun <init> (Ldev/inmo/tgbotapi/types/ChatIdentifier;JLjava/util/List;Ljava/lang/Boolean;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun <init> (Ldev/inmo/tgbotapi/types/ChatIdentifier;JLjava/util/List;Ljava/lang/Boolean;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun <init> (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Ljava/lang/Boolean;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun <init> (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Ljava/lang/Boolean;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun <init> (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/lang/Boolean;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun <init> (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/lang/Boolean;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun <init> (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Ljava/util/List;Ljava/lang/Boolean;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun <init> (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Ljava/util/List;Ljava/lang/Boolean;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun <init> (Lkotlin/Triple;Ljava/lang/Boolean;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun <init> (Lkotlin/Triple;Ljava/lang/Boolean;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun <init> (Lkotlin/Triple;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/lang/Boolean;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun <init> (Lkotlin/Triple;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/lang/Boolean;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun <init> (Lkotlin/Triple;Ljava/util/List;Ljava/lang/Boolean;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun <init> (Lkotlin/Triple;Ljava/util/List;Ljava/lang/Boolean;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun component1 ()Ldev/inmo/tgbotapi/types/ChatIdentifier;
public final fun component2-APLFQys ()J
public final fun component3 ()Ljava/lang/Boolean;
@@ -15348,8 +15330,6 @@ public final class dev/inmo/tgbotapi/types/ReplyParameters$Chat : dev/inmo/tgbot
public final fun component7 ()Ljava/lang/Integer;
public final fun component8-Wby8Lsc ()Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;
public final fun component9-y3a_nt8 ()Ljava/lang/String;
public final fun copy-LVJNs80 (Ldev/inmo/tgbotapi/types/ChatIdentifier;JLjava/lang/Boolean;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/util/List;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;)Ldev/inmo/tgbotapi/types/ReplyParameters$Chat;
public static synthetic fun copy-LVJNs80$default (Ldev/inmo/tgbotapi/types/ReplyParameters$Chat;Ldev/inmo/tgbotapi/types/ChatIdentifier;JLjava/lang/Boolean;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/util/List;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/ReplyParameters$Chat;
public fun equals (Ljava/lang/Object;)Z
public fun getAllowSendingWithoutReply ()Ljava/lang/Boolean;
public final fun getChatIdentifier ()Ldev/inmo/tgbotapi/types/ChatIdentifier;
@@ -15371,6 +15351,24 @@ public final class dev/inmo/tgbotapi/types/ReplyParameters$Chat$Companion {
}
public final class dev/inmo/tgbotapi/types/ReplyParameters$Companion {
public final fun invoke-0u1beqo (Ldev/inmo/tgbotapi/types/ChatIdentifier;JLjava/util/List;Ljava/lang/Boolean;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;)Ldev/inmo/tgbotapi/types/ReplyParameters$Chat;
public static synthetic fun invoke-0u1beqo$default (Ldev/inmo/tgbotapi/types/ReplyParameters$Companion;Ldev/inmo/tgbotapi/types/ChatIdentifier;JLjava/util/List;Ljava/lang/Boolean;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/ReplyParameters$Chat;
public final fun invoke-BPLC4m8 (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Ljava/util/List;Ljava/lang/Boolean;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;)Ldev/inmo/tgbotapi/types/ReplyParameters$Chat;
public static synthetic fun invoke-BPLC4m8$default (Ldev/inmo/tgbotapi/types/ReplyParameters$Companion;Ldev/inmo/tgbotapi/types/message/abstracts/Message;Ljava/util/List;Ljava/lang/Boolean;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/ReplyParameters$Chat;
public final fun invoke-HmWr8k0 (Ldev/inmo/tgbotapi/types/ChatIdentifier;JLjava/lang/Boolean;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;)Ldev/inmo/tgbotapi/types/ReplyParameters$Chat;
public static synthetic fun invoke-HmWr8k0$default (Ldev/inmo/tgbotapi/types/ReplyParameters$Companion;Ldev/inmo/tgbotapi/types/ChatIdentifier;JLjava/lang/Boolean;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/ReplyParameters$Chat;
public final fun invoke-SSz3Fa8 (Lkotlin/Triple;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/lang/Boolean;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;)Ldev/inmo/tgbotapi/types/ReplyParameters$Chat;
public static synthetic fun invoke-SSz3Fa8$default (Ldev/inmo/tgbotapi/types/ReplyParameters$Companion;Lkotlin/Triple;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/lang/Boolean;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/ReplyParameters$Chat;
public final fun invoke-YCjLccs (Ldev/inmo/tgbotapi/types/ChatIdentifier;JLjava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/lang/Boolean;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;)Ldev/inmo/tgbotapi/types/ReplyParameters$Chat;
public static synthetic fun invoke-YCjLccs$default (Ldev/inmo/tgbotapi/types/ReplyParameters$Companion;Ldev/inmo/tgbotapi/types/ChatIdentifier;JLjava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/lang/Boolean;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/ReplyParameters$Chat;
public final fun invoke-Z5nmqEk (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/lang/Boolean;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;)Ldev/inmo/tgbotapi/types/ReplyParameters$Chat;
public static synthetic fun invoke-Z5nmqEk$default (Ldev/inmo/tgbotapi/types/ReplyParameters$Companion;Ldev/inmo/tgbotapi/types/message/abstracts/Message;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/lang/Boolean;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/ReplyParameters$Chat;
public final fun invoke-_9xweQk (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Ljava/lang/Boolean;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;)Ldev/inmo/tgbotapi/types/ReplyParameters$Chat;
public static synthetic fun invoke-_9xweQk$default (Ldev/inmo/tgbotapi/types/ReplyParameters$Companion;Ldev/inmo/tgbotapi/types/message/abstracts/Message;Ljava/lang/Boolean;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/ReplyParameters$Chat;
public final fun invoke-sl8XBEg (Lkotlin/Triple;Ljava/util/List;Ljava/lang/Boolean;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;)Ldev/inmo/tgbotapi/types/ReplyParameters$Chat;
public static synthetic fun invoke-sl8XBEg$default (Ldev/inmo/tgbotapi/types/ReplyParameters$Companion;Lkotlin/Triple;Ljava/util/List;Ljava/lang/Boolean;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/ReplyParameters$Chat;
public final fun invoke-yfm4f28 (Lkotlin/Triple;Ljava/lang/Boolean;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;)Ldev/inmo/tgbotapi/types/ReplyParameters$Chat;
public static synthetic fun invoke-yfm4f28$default (Ldev/inmo/tgbotapi/types/ReplyParameters$Companion;Lkotlin/Triple;Ljava/lang/Boolean;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/ReplyParameters$Chat;
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}

View File

@@ -1,6 +1,7 @@
package dev.inmo.tgbotapi.types
import dev.inmo.tgbotapi.abstracts.TextedInput
import dev.inmo.tgbotapi.abstracts.WithMessageId
import dev.inmo.tgbotapi.types.checklists.ChecklistTaskId
import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.message.RawMessageEntity
@@ -28,7 +29,8 @@ sealed interface ReplyParameters {
/**
* Reply parameters targeting a regular message identified by [messageId]. A `null` [chatIdentifier] targets a
* message in the current chat; a non-null [chatIdentifier] targets a message in a different chat.
* message in the current chat; a non-null [chatIdentifier] targets a message in a different chat. Public
* construction uses the `ReplyParameters(...)` companion factories.
*/
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
@ConsistentCopyVisibility
@@ -43,46 +45,12 @@ sealed interface ReplyParameters {
val quotePosition: Int? = null,
val checklistTaskId: ChecklistTaskId? = null,
val pollOptionId: PollOptionPersistentId? = null,
) : ReplyParameters, TextedInput {
) : WithMessageId, ReplyParameters, TextedInput {
override val text: String?
get() = quote
override val textSources: List<TextSource> by lazy {
quoteEntities ?.asTextSources(quote ?: return@lazy emptyList()) ?: emptyList()
}
constructor(
chatIdentifier: ChatIdentifier,
messageId: MessageId,
entities: TextSourcesList,
allowSendingWithoutReply: Boolean? = null,
quotePosition: Int? = null,
checklistTaskId: ChecklistTaskId? = null,
pollOptionId: PollOptionPersistentId? = null,
) : this(chatIdentifier, messageId, allowSendingWithoutReply, entities.makeSourceString(), null, entities.toRawMessageEntities(), quotePosition, checklistTaskId, pollOptionId)
constructor(metaInfo: Message.MetaInfo, entities: TextSourcesList, allowSendingWithoutReply: Boolean? = null, quotePosition: Int? = null, checklistTaskId: ChecklistTaskId? = null, pollOptionId: PollOptionPersistentId? = null) :
this(metaInfo.chatId, metaInfo.messageId, entities, allowSendingWithoutReply, quotePosition, checklistTaskId, pollOptionId)
constructor(message: Message, entities: TextSourcesList, allowSendingWithoutReply: Boolean? = null, quotePosition: Int? = null, checklistTaskId: ChecklistTaskId? = null, pollOptionId: PollOptionPersistentId? = null) :
this(message.metaInfo, entities, allowSendingWithoutReply, quotePosition, checklistTaskId, pollOptionId)
constructor(chatIdentifier: ChatIdentifier, messageId: MessageId, quote: String, quoteParseMode: ParseMode, allowSendingWithoutReply: Boolean? = null, quotePosition: Int? = null, checklistTaskId: ChecklistTaskId? = null, pollOptionId: PollOptionPersistentId? = null) :
this(chatIdentifier, messageId, allowSendingWithoutReply, quote, quoteParseMode, null, quotePosition, checklistTaskId, pollOptionId)
constructor(metaInfo: Message.MetaInfo, quote: String, quoteParseMode: ParseMode, allowSendingWithoutReply: Boolean? = null, quotePosition: Int? = null, checklistTaskId: ChecklistTaskId? = null, pollOptionId: PollOptionPersistentId? = null) :
this(metaInfo.chatId, metaInfo.messageId, quote, quoteParseMode, allowSendingWithoutReply, quotePosition, checklistTaskId, pollOptionId)
constructor(message: Message, quote: String, quoteParseMode: ParseMode, allowSendingWithoutReply: Boolean? = null, quotePosition: Int? = null, checklistTaskId: ChecklistTaskId? = null, pollOptionId: PollOptionPersistentId? = null) :
this(message.metaInfo, quote, quoteParseMode, allowSendingWithoutReply, quotePosition, checklistTaskId, pollOptionId)
constructor(chatIdentifier: ChatIdentifier, messageId: MessageId, allowSendingWithoutReply: Boolean? = null, quotePosition: Int? = null, checklistTaskId: ChecklistTaskId? = null, pollOptionId: PollOptionPersistentId? = null) :
this(chatIdentifier, messageId, allowSendingWithoutReply, null, null, null, quotePosition, checklistTaskId, pollOptionId)
constructor(metaInfo: Message.MetaInfo, allowSendingWithoutReply: Boolean? = null, quotePosition: Int? = null, checklistTaskId: ChecklistTaskId? = null, pollOptionId: PollOptionPersistentId? = null) :
this(metaInfo.chatId, metaInfo.messageId, allowSendingWithoutReply, quotePosition, checklistTaskId, pollOptionId)
constructor(message: Message, allowSendingWithoutReply: Boolean? = null, quotePosition: Int? = null, checklistTaskId: ChecklistTaskId? = null, pollOptionId: PollOptionPersistentId? = null) :
this(message.metaInfo, allowSendingWithoutReply, quotePosition, checklistTaskId, pollOptionId)
}
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
@@ -98,6 +66,167 @@ sealed interface ReplyParameters {
override val messageId: MessageId? = null
}
companion object {
operator fun invoke(
chatIdentifier: ChatIdentifier,
messageId: MessageId,
entities: TextSourcesList,
allowSendingWithoutReply: Boolean? = null,
quotePosition: Int? = null,
checklistTaskId: ChecklistTaskId? = null,
pollOptionId: PollOptionPersistentId? = null,
): Chat = Chat(
chatIdentifier,
messageId,
allowSendingWithoutReply,
entities.makeSourceString(),
null,
entities.toRawMessageEntities(),
quotePosition,
checklistTaskId,
pollOptionId
)
operator fun invoke(
metaInfo: Message.MetaInfo,
entities: TextSourcesList,
allowSendingWithoutReply: Boolean? = null,
quotePosition: Int? = null,
checklistTaskId: ChecklistTaskId? = null,
pollOptionId: PollOptionPersistentId? = null,
): Chat = invoke(
metaInfo.chatId,
metaInfo.messageId,
entities,
allowSendingWithoutReply,
quotePosition,
checklistTaskId,
pollOptionId
)
operator fun invoke(
message: Message,
entities: TextSourcesList,
allowSendingWithoutReply: Boolean? = null,
quotePosition: Int? = null,
checklistTaskId: ChecklistTaskId? = null,
pollOptionId: PollOptionPersistentId? = null,
): Chat = invoke(
message.metaInfo,
entities,
allowSendingWithoutReply,
quotePosition,
checklistTaskId,
pollOptionId
)
operator fun invoke(
chatIdentifier: ChatIdentifier,
messageId: MessageId,
quote: String,
quoteParseMode: ParseMode,
allowSendingWithoutReply: Boolean? = null,
quotePosition: Int? = null,
checklistTaskId: ChecklistTaskId? = null,
pollOptionId: PollOptionPersistentId? = null,
): Chat = Chat(
chatIdentifier,
messageId,
allowSendingWithoutReply,
quote,
quoteParseMode,
null,
quotePosition,
checklistTaskId,
pollOptionId
)
operator fun invoke(
metaInfo: Message.MetaInfo,
quote: String,
quoteParseMode: ParseMode,
allowSendingWithoutReply: Boolean? = null,
quotePosition: Int? = null,
checklistTaskId: ChecklistTaskId? = null,
pollOptionId: PollOptionPersistentId? = null,
): Chat = invoke(
metaInfo.chatId,
metaInfo.messageId,
quote,
quoteParseMode,
allowSendingWithoutReply,
quotePosition,
checklistTaskId,
pollOptionId
)
operator fun invoke(
message: Message,
quote: String,
quoteParseMode: ParseMode,
allowSendingWithoutReply: Boolean? = null,
quotePosition: Int? = null,
checklistTaskId: ChecklistTaskId? = null,
pollOptionId: PollOptionPersistentId? = null,
): Chat = invoke(
message.metaInfo,
quote,
quoteParseMode,
allowSendingWithoutReply,
quotePosition,
checklistTaskId,
pollOptionId
)
operator fun invoke(
chatIdentifier: ChatIdentifier,
messageId: MessageId,
allowSendingWithoutReply: Boolean? = null,
quotePosition: Int? = null,
checklistTaskId: ChecklistTaskId? = null,
pollOptionId: PollOptionPersistentId? = null,
): Chat = Chat(
chatIdentifier,
messageId,
allowSendingWithoutReply,
null,
null,
null,
quotePosition,
checklistTaskId,
pollOptionId
)
operator fun invoke(
metaInfo: Message.MetaInfo,
allowSendingWithoutReply: Boolean? = null,
quotePosition: Int? = null,
checklistTaskId: ChecklistTaskId? = null,
pollOptionId: PollOptionPersistentId? = null,
): Chat = invoke(
metaInfo.chatId,
metaInfo.messageId,
allowSendingWithoutReply,
quotePosition,
checklistTaskId,
pollOptionId
)
operator fun invoke(
message: Message,
allowSendingWithoutReply: Boolean? = null,
quotePosition: Int? = null,
checklistTaskId: ChecklistTaskId? = null,
pollOptionId: PollOptionPersistentId? = null,
): Chat = invoke(
message.metaInfo,
allowSendingWithoutReply,
quotePosition,
checklistTaskId,
pollOptionId
)
}
object Serializer : KSerializer<ReplyParameters> {
@Serializable
private data class Surrogate(

View File

@@ -192,7 +192,7 @@ sealed interface ResendableContent {
effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyToMessageId ?.let {
ReplyParameters.Chat(
ReplyParameters(
chatId,
replyToMessageId,
allowSendingWithoutReply = allowSendingWithoutReply

View File

@@ -16,7 +16,7 @@ class ReplyParametersSerializationTest {
@Test
fun chatRoundTripUsesFlatShape() {
val value: ReplyParameters = ReplyParameters.Chat(
val value: ReplyParameters = ReplyParameters(
ChatId(RawChatId(123L)),
MessageId(456L),
allowSendingWithoutReply = true