From db0df975c749e8be1d03fa86b1dae90263219eab Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 3 Jul 2025 22:07:16 +0600 Subject: [PATCH 01/16] start 26.1.0 --- CHANGELOG.md | 2 ++ gradle.properties | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e5f6ba49c..2a8f6819ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # TelegramBotAPI changelog +## 26.1.0 + ## 26.0.0 **THIS UPDATE CONTAINS BREAKING CHANGES IN BEHAVIOUR BUILDER AND CORE. BE CAREFUL ON UPDATE** diff --git a/gradle.properties b/gradle.properties index 4c760d2968..7280868dcf 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,4 +6,4 @@ kotlin.incremental=true kotlin.incremental.js=true library_group=dev.inmo -library_version=26.0.0 +library_version=26.1.0 From e4fb45c09b37e4174f77125a4f2d976d551aa638 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 3 Jul 2025 22:25:47 +0600 Subject: [PATCH 02/16] start realize Bots API 9.1 --- .../kotlin/dev/inmo/tgbotapi/types/Common.kt | 2 + .../types/checklists/ChecklistTask.kt | 140 ++++++++++++++++++ .../types/checklists/ChecklistTaskId.kt | 10 ++ 3 files changed, 152 insertions(+) create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/ChecklistTask.kt create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/ChecklistTaskId.kt diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt index e8fdad6511..b14b023515 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt @@ -308,6 +308,8 @@ const val pendingJoinRequestCountField = "pending_join_request_count" const val memberLimitField = "member_limit" const val iconColorField = "icon_color" const val emojiListField = "emoji_list" +const val completedByUserField = "completed_by_user" +const val completionDateField = "completion_date" const val requestContactField = "request_contact" const val requestLocationField = "request_location" diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/ChecklistTask.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/ChecklistTask.kt new file mode 100644 index 0000000000..3a9af155e9 --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/ChecklistTask.kt @@ -0,0 +1,140 @@ +package dev.inmo.tgbotapi.types.checklists + +import dev.inmo.tgbotapi.abstracts.TextedInput +import dev.inmo.tgbotapi.types.TelegramDate +import dev.inmo.tgbotapi.types.chat.PreviewUser +import dev.inmo.tgbotapi.types.completedByUserField +import dev.inmo.tgbotapi.types.completionDateField +import dev.inmo.tgbotapi.types.idField +import dev.inmo.tgbotapi.types.message.RawMessageEntity +import dev.inmo.tgbotapi.types.message.asTextSources +import dev.inmo.tgbotapi.types.message.textsources.RegularTextSource +import dev.inmo.tgbotapi.types.message.textsources.TextSource +import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList +import dev.inmo.tgbotapi.types.message.toRawMessageEntities +import dev.inmo.tgbotapi.types.textEntitiesField +import dev.inmo.tgbotapi.types.textField +import dev.inmo.tgbotapi.utils.RiskFeature +import dev.inmo.tgbotapi.utils.extensions.makeSourceString +import kotlinx.serialization.EncodeDefault +import kotlinx.serialization.ExperimentalSerializationApi +import kotlinx.serialization.KSerializer +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.descriptors.SerialDescriptor +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder + +@Serializable +sealed interface ChecklistTask : TextedInput { + val id: ChecklistTaskId + override val text: String + val completedByUser: PreviewUser? + get() = null + val completionDate: TelegramDate? + get() = null + + @Serializable + data class Undone( + @SerialName(idField) + override val id: ChecklistTaskId, + @SerialName(textEntitiesField) + override val textSources: List = emptyList(), + ) : ChecklistTask { + @OptIn(ExperimentalSerializationApi::class) + @EncodeDefault + @Serializable + @SerialName(textField) + override val text: String = textSources.makeSourceString() + + constructor(id: ChecklistTaskId, text: String): this( + id, + listOf( + RegularTextSource(text) + ) + ) + } + + @Serializable + data class Done( + @SerialName(idField) + override val id: ChecklistTaskId, + @SerialName(completedByUserField) + override val completedByUser: PreviewUser, + @SerialName(completionDateField) + override val completionDate: TelegramDate, + @SerialName(textEntitiesField) + override val textSources: List = emptyList() + ) : ChecklistTask { + @OptIn(ExperimentalSerializationApi::class) + @EncodeDefault + @Serializable + @SerialName(textField) + override val text: String = textSources.makeSourceString() + + constructor( + id: ChecklistTaskId, + text: String, + completedByUser: PreviewUser, + completionDate: TelegramDate, + ): this( + id, + completedByUser, + completionDate, + listOf( + RegularTextSource(text) + ) + ) + } + + + @RiskFeature + object Serializer : KSerializer { + @Serializable + private data class RawChecklistTask( + @SerialName(idField) + val id: ChecklistTaskId, + @SerialName(textField) + val text: String, + @SerialName(textEntitiesField) + val textSources: List = emptyList(), + @SerialName(completedByUserField) + val completedByUser: PreviewUser? = null, + @SerialName(completionDateField) + val completionDate: TelegramDate = TelegramDate(0), // TelegramDate(0) is the default according to https://core.telegram.org/bots/api#checklisttask + ) + override val descriptor: SerialDescriptor = RawChecklistTask.serializer().descriptor + + override fun deserialize(decoder: Decoder): ChecklistTask { + val raw = RawChecklistTask.serializer().deserialize( + decoder + ) + + return when { + raw.completedByUser != null -> Done( + id = raw.id, + completedByUser = raw.completedByUser, + completionDate = raw.completionDate, + textSources = raw.textSources.asTextSources(raw.text), + ) + else -> Undone( + id = raw.id, + textSources = raw.textSources.asTextSources(raw.text), + ) + } + } + + override fun serialize(encoder: Encoder, value: ChecklistTask) { + RawChecklistTask.serializer().serialize( + encoder, + RawChecklistTask( + id = value.id, + text = value.text, + completedByUser = value.completedByUser, + completionDate = value.completionDate ?: TelegramDate(0), + textSources = value.textSources.toRawMessageEntities() + ) + ) + } + } +} \ No newline at end of file diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/ChecklistTaskId.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/ChecklistTaskId.kt new file mode 100644 index 0000000000..3d50703dc4 --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/ChecklistTaskId.kt @@ -0,0 +1,10 @@ +package dev.inmo.tgbotapi.types.checklists + +import kotlinx.serialization.Serializable +import kotlin.jvm.JvmInline + +@Serializable +@JvmInline +value class ChecklistTaskId( + val int: Int +) From 0a01d2567e4de22fc7c6d1387edaf2cb0adfecb0 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 4 Jul 2025 11:53:16 +0600 Subject: [PATCH 03/16] add checklist --- .../kotlin/dev/inmo/tgbotapi/types/Common.kt | 3 + .../tgbotapi/types/checklists/Checklist.kt | 62 +++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/Checklist.kt diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt index b14b023515..53aabe0333 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt @@ -310,6 +310,9 @@ const val iconColorField = "icon_color" const val emojiListField = "emoji_list" const val completedByUserField = "completed_by_user" const val completionDateField = "completion_date" +const val titleEntitiesField = "title_entities" +const val othersCanAddTasksField = "others_can_add_tasks" +const val othersCanMarkTasksAsDoneField = "others_can_mark_tasks_as_done" const val requestContactField = "request_contact" const val requestLocationField = "request_location" diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/Checklist.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/Checklist.kt new file mode 100644 index 0000000000..dd531ff73a --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/Checklist.kt @@ -0,0 +1,62 @@ +package dev.inmo.tgbotapi.types.checklists + +import dev.inmo.tgbotapi.types.message.RawMessageEntity +import dev.inmo.tgbotapi.types.message.asTextSources +import dev.inmo.tgbotapi.types.message.textsources.TextSource +import dev.inmo.tgbotapi.types.message.toRawMessageEntities +import dev.inmo.tgbotapi.utils.extensions.makeSourceString +import kotlinx.serialization.KSerializer +import kotlinx.serialization.Serializable +import kotlinx.serialization.descriptors.SerialDescriptor +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder + +@Serializable(Checklist.Companion::class) +data class Checklist( + val titleTextSources: List, + val tasks: List, + val othersCanAddTasks: Boolean = false, + val othersCanCompleteTasks: Boolean = false, +) { + val title: String by lazy { + titleTextSources.makeSourceString() + } + + companion object : KSerializer { + @Serializable + private class RawChecklist( + val title: String, + val title_entities: List = emptyList(), + val tasks: List, + val others_can_add_tasks: Boolean = false, + val others_can_mark_tasks_as_done: Boolean = false, + ) + override val descriptor: SerialDescriptor = RawChecklist.serializer().descriptor + + override fun serialize( + encoder: Encoder, + value: Checklist + ) { + RawChecklist.serializer().serialize( + encoder, + RawChecklist( + title = value.title, + title_entities = value.titleTextSources.toRawMessageEntities(), + tasks = value.tasks, + others_can_add_tasks = value.othersCanAddTasks, + others_can_mark_tasks_as_done = value.othersCanCompleteTasks, + ) + ) + } + + override fun deserialize(decoder: Decoder): Checklist { + val raw = RawChecklist.serializer().deserialize(decoder) + return Checklist( + titleTextSources = raw.title_entities.asTextSources(raw.title), + tasks = raw.tasks, + othersCanAddTasks = raw.others_can_add_tasks, + othersCanCompleteTasks = raw.others_can_mark_tasks_as_done + ) + } + } +} From e2ce9cfebf80ccdb70910c06c558a490125f4615 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Mon, 7 Jul 2025 14:38:39 +0600 Subject: [PATCH 04/16] preview version of inputs for tasks --- .../dev/inmo/tgbotapi/abstracts/Texted.kt | 9 + .../kotlin/dev/inmo/tgbotapi/types/Common.kt | 1 + .../tgbotapi/types/checklists/Checklist.kt | 152 ++++++++++---- .../types/checklists/ChecklistTask.kt | 195 +++++++++++++----- .../types/checklists/ChecklistTaskId.kt | 2 +- .../types/checklists/InputChecklist.kt | 15 ++ 6 files changed, 280 insertions(+), 94 deletions(-) create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/InputChecklist.kt diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/Texted.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/Texted.kt index e2351b5994..a52c86b5c9 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/Texted.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/Texted.kt @@ -27,3 +27,12 @@ interface TextedOutput : ParsableOutput, EntitiesOutput interface TextedInput : TextedWithTextSources { override val textSources: List } + +interface TitledInput : TextedInput { + val title: String + val titleTextSources: List + override val text: String + get() = title + override val textSources: List + get() = titleTextSources +} diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt index 53aabe0333..8bf51d5140 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt @@ -311,6 +311,7 @@ const val emojiListField = "emoji_list" const val completedByUserField = "completed_by_user" const val completionDateField = "completion_date" const val titleEntitiesField = "title_entities" +const val tasksField = "tasks" const val othersCanAddTasksField = "others_can_add_tasks" const val othersCanMarkTasksAsDoneField = "others_can_mark_tasks_as_done" diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/Checklist.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/Checklist.kt index dd531ff73a..e8e9751ddd 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/Checklist.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/Checklist.kt @@ -1,62 +1,132 @@ package dev.inmo.tgbotapi.types.checklists +import dev.inmo.micro_utils.common.Warning +import dev.inmo.tgbotapi.abstracts.TitledInput +import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.RawMessageEntity import dev.inmo.tgbotapi.types.message.asTextSources +import dev.inmo.tgbotapi.types.message.parseModeField import dev.inmo.tgbotapi.types.message.textsources.TextSource import dev.inmo.tgbotapi.types.message.toRawMessageEntities +import dev.inmo.tgbotapi.types.tasksField +import dev.inmo.tgbotapi.types.titleEntitiesField +import dev.inmo.tgbotapi.types.titleField import dev.inmo.tgbotapi.utils.extensions.makeSourceString import kotlinx.serialization.KSerializer +import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable import kotlinx.serialization.descriptors.SerialDescriptor import kotlinx.serialization.encoding.Decoder import kotlinx.serialization.encoding.Encoder -@Serializable(Checklist.Companion::class) -data class Checklist( - val titleTextSources: List, - val tasks: List, - val othersCanAddTasks: Boolean = false, - val othersCanCompleteTasks: Boolean = false, -) { - val title: String by lazy { - titleTextSources.makeSourceString() +@Serializable +sealed interface Checklist : TitledInput { + val tasks: List + val othersCanAddTasks: Boolean + val othersCanCompleteTasks: Boolean + @Serializable + data class Input @Warning("It is low level API. Do not use it without need") constructor( + @SerialName(titleField) + override val title: String, + @SerialName(tasksField) + override val tasks: List, + @SerialName(parseModeField) + val parseMode: ParseMode? = null, + @SerialName(titleEntitiesField) + override val titleTextSources: List = emptyList(), + override val othersCanAddTasks: Boolean = false, + override val othersCanCompleteTasks: Boolean = false, + ) : Checklist { + companion object : KSerializer { + @Serializable + private class RawChecklist( + val title: String, + val parseMode: ParseMode? = null, + val title_entities: List = emptyList(), + val tasks: List, + val others_can_add_tasks: Boolean = false, + val others_can_mark_tasks_as_done: Boolean = false, + ) + override val descriptor: SerialDescriptor = RawChecklist.serializer().descriptor + + override fun serialize( + encoder: Encoder, + value: Input + ) { + RawChecklist.serializer().serialize( + encoder, + RawChecklist( + title = value.title, + title_entities = value.titleTextSources.toRawMessageEntities(), + tasks = value.tasks, + parseMode = value.parseMode, + others_can_add_tasks = value.othersCanAddTasks, + others_can_mark_tasks_as_done = value.othersCanCompleteTasks, + ) + ) + } + + override fun deserialize(decoder: Decoder): Input { + val raw = RawChecklist.serializer().deserialize(decoder) + return Input( + title = raw.title, + titleTextSources = raw.title_entities.asTextSources(raw.title), + tasks = raw.tasks, + parseMode = raw.parseMode, + othersCanAddTasks = raw.others_can_add_tasks, + othersCanCompleteTasks = raw.others_can_mark_tasks_as_done + ) + } + } } - companion object : KSerializer { - @Serializable - private class RawChecklist( - val title: String, - val title_entities: List = emptyList(), - val tasks: List, - val others_can_add_tasks: Boolean = false, - val others_can_mark_tasks_as_done: Boolean = false, - ) - override val descriptor: SerialDescriptor = RawChecklist.serializer().descriptor - - override fun serialize( - encoder: Encoder, - value: Checklist - ) { - RawChecklist.serializer().serialize( - encoder, - RawChecklist( - title = value.title, - title_entities = value.titleTextSources.toRawMessageEntities(), - tasks = value.tasks, - others_can_add_tasks = value.othersCanAddTasks, - others_can_mark_tasks_as_done = value.othersCanCompleteTasks, - ) - ) + @Serializable(Created.Companion::class) + data class Created( + override val titleTextSources: List, + override val tasks: List, + override val othersCanAddTasks: Boolean = false, + override val othersCanCompleteTasks: Boolean = false, + ): Checklist { + override val title: String by lazy { + titleTextSources.makeSourceString() } - override fun deserialize(decoder: Decoder): Checklist { - val raw = RawChecklist.serializer().deserialize(decoder) - return Checklist( - titleTextSources = raw.title_entities.asTextSources(raw.title), - tasks = raw.tasks, - othersCanAddTasks = raw.others_can_add_tasks, - othersCanCompleteTasks = raw.others_can_mark_tasks_as_done + companion object : KSerializer { + @Serializable + private class RawChecklist( + val title: String, + val title_entities: List = emptyList(), + val tasks: List, + val others_can_add_tasks: Boolean = false, + val others_can_mark_tasks_as_done: Boolean = false, ) + override val descriptor: SerialDescriptor = RawChecklist.serializer().descriptor + + override fun serialize( + encoder: Encoder, + value: Created + ) { + RawChecklist.serializer().serialize( + encoder, + RawChecklist( + title = value.title, + title_entities = value.titleTextSources.toRawMessageEntities(), + tasks = value.tasks, + others_can_add_tasks = value.othersCanAddTasks, + others_can_mark_tasks_as_done = value.othersCanCompleteTasks, + ) + ) + } + + override fun deserialize(decoder: Decoder): Created { + val raw = RawChecklist.serializer().deserialize(decoder) + return Created( + titleTextSources = raw.title_entities.asTextSources(raw.title), + tasks = raw.tasks, + othersCanAddTasks = raw.others_can_add_tasks, + othersCanCompleteTasks = raw.others_can_mark_tasks_as_done + ) + } } } } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/ChecklistTask.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/ChecklistTask.kt index 3a9af155e9..71702f07a7 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/ChecklistTask.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/ChecklistTask.kt @@ -1,19 +1,28 @@ package dev.inmo.tgbotapi.types.checklists +import dev.inmo.micro_utils.common.Warning import dev.inmo.tgbotapi.abstracts.TextedInput +import dev.inmo.tgbotapi.abstracts.TitledInput import dev.inmo.tgbotapi.types.TelegramDate import dev.inmo.tgbotapi.types.chat.PreviewUser import dev.inmo.tgbotapi.types.completedByUserField import dev.inmo.tgbotapi.types.completionDateField import dev.inmo.tgbotapi.types.idField +import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.RawMessageEntity import dev.inmo.tgbotapi.types.message.asTextSources +import dev.inmo.tgbotapi.types.message.parseModeField import dev.inmo.tgbotapi.types.message.textsources.RegularTextSource import dev.inmo.tgbotapi.types.message.textsources.TextSource -import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.message.toRawMessageEntities +import dev.inmo.tgbotapi.types.tasksField import dev.inmo.tgbotapi.types.textEntitiesField import dev.inmo.tgbotapi.types.textField +import dev.inmo.tgbotapi.types.textParseModeField +import dev.inmo.tgbotapi.types.titleEntitiesField +import dev.inmo.tgbotapi.types.titleField +import dev.inmo.tgbotapi.utils.EntitiesBuilder +import dev.inmo.tgbotapi.utils.EntitiesBuilderBody import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.extensions.makeSourceString import kotlinx.serialization.EncodeDefault @@ -29,18 +38,93 @@ import kotlinx.serialization.encoding.Encoder sealed interface ChecklistTask : TextedInput { val id: ChecklistTaskId override val text: String - val completedByUser: PreviewUser? - get() = null - val completionDate: TelegramDate? - get() = null - @Serializable + data class InputChecklist @Warning("It is low level API. Do not use it without need") constructor( + @SerialName(titleField) + override val title: String, + @SerialName(tasksField) + val tasks: List, + @SerialName(parseModeField) + val parseMode: ParseMode? = null, + @SerialName(titleEntitiesField) + override val titleTextSources: List = emptyList(), + + ) : TitledInput + + @Serializable(Input.Companion::class) + data class Input @Warning("It is low level API. Do not use it without need") constructor( + @SerialName(idField) + override val id: ChecklistTaskId, + @SerialName(textField) + override val text: String, + @SerialName(textParseModeField) + val parseMode: ParseMode? = null, + @SerialName(textEntitiesField) + override val textSources: List = emptyList(), + ) : ChecklistTask { + constructor(id: ChecklistTaskId, text: String, parseMode: ParseMode? = null) : this( + id = id, + text = text, + parseMode = parseMode, + textSources = emptyList() + ) + constructor(id: ChecklistTaskId, textSources: List) : this( + id = id, + text = textSources.makeSourceString(), + parseMode = null, + textSources = textSources + ) + constructor(id: ChecklistTaskId, builderBody: EntitiesBuilderBody) : this( + id = id, + textSources = EntitiesBuilder().apply(builderBody).build() + ) + + companion object : KSerializer { + @Serializable + private data class RawInput( + @SerialName(idField) + val id: ChecklistTaskId, + @SerialName(textField) + val text: String, + @SerialName(textParseModeField) + val parseMode: ParseMode? = null, + @SerialName(textEntitiesField) + val textSources: List = emptyList(), + ) + override val descriptor: SerialDescriptor + get() = RawInput.serializer().descriptor + + override fun deserialize(decoder: Decoder): Input { + val raw = RawInput.serializer().deserialize(decoder) + return Input( + raw.id, + raw.text, + raw.parseMode, + raw.textSources.asTextSources(raw.text) + ) + } + + override fun serialize(encoder: Encoder, value: Input) { + RawInput.serializer().serialize( + encoder, + RawInput( + value.id, + value.text, + value.parseMode, + value.textSources.toRawMessageEntities() + ) + ) + } + } + } + + @Serializable(Created.Serializer::class) data class Undone( @SerialName(idField) override val id: ChecklistTaskId, @SerialName(textEntitiesField) override val textSources: List = emptyList(), - ) : ChecklistTask { + ) : ChecklistTask.Created { @OptIn(ExperimentalSerializationApi::class) @EncodeDefault @Serializable @@ -55,7 +139,7 @@ sealed interface ChecklistTask : TextedInput { ) } - @Serializable + @Serializable(Created.Serializer::class) data class Done( @SerialName(idField) override val id: ChecklistTaskId, @@ -65,7 +149,7 @@ sealed interface ChecklistTask : TextedInput { override val completionDate: TelegramDate, @SerialName(textEntitiesField) override val textSources: List = emptyList() - ) : ChecklistTask { + ) : ChecklistTask.Created { @OptIn(ExperimentalSerializationApi::class) @EncodeDefault @Serializable @@ -86,55 +170,62 @@ sealed interface ChecklistTask : TextedInput { ) ) } - - - @RiskFeature - object Serializer : KSerializer { - @Serializable - private data class RawChecklistTask( - @SerialName(idField) - val id: ChecklistTaskId, - @SerialName(textField) - val text: String, - @SerialName(textEntitiesField) - val textSources: List = emptyList(), - @SerialName(completedByUserField) - val completedByUser: PreviewUser? = null, - @SerialName(completionDateField) - val completionDate: TelegramDate = TelegramDate(0), // TelegramDate(0) is the default according to https://core.telegram.org/bots/api#checklisttask - ) - override val descriptor: SerialDescriptor = RawChecklistTask.serializer().descriptor - override fun deserialize(decoder: Decoder): ChecklistTask { - val raw = RawChecklistTask.serializer().deserialize( - decoder + @Serializable(Created.Serializer::class) + sealed interface Created : ChecklistTask { + val completedByUser: PreviewUser? + get() = null + val completionDate: TelegramDate? + get() = null + + @RiskFeature + object Serializer : KSerializer { + @Serializable + private data class RawCreatedChecklistTask( + @SerialName(idField) + val id: ChecklistTaskId, + @SerialName(textField) + val text: String, + @SerialName(textEntitiesField) + val textSources: List = emptyList(), + @SerialName(completedByUserField) + val completedByUser: PreviewUser? = null, + @SerialName(completionDateField) + val completionDate: TelegramDate = TelegramDate(0), // TelegramDate(0) is the default according to https://core.telegram.org/bots/api#checklisttask ) + override val descriptor: SerialDescriptor = RawCreatedChecklistTask.serializer().descriptor - return when { - raw.completedByUser != null -> Done( - id = raw.id, - completedByUser = raw.completedByUser, - completionDate = raw.completionDate, - textSources = raw.textSources.asTextSources(raw.text), + override fun deserialize(decoder: Decoder): Created { + val raw = RawCreatedChecklistTask.serializer().deserialize( + decoder ) - else -> Undone( - id = raw.id, - textSources = raw.textSources.asTextSources(raw.text), + + return when { + raw.completedByUser != null -> Done( + id = raw.id, + completedByUser = raw.completedByUser, + completionDate = raw.completionDate, + textSources = raw.textSources.asTextSources(raw.text), + ) + else -> Undone( + id = raw.id, + textSources = raw.textSources.asTextSources(raw.text), + ) + } + } + + override fun serialize(encoder: Encoder, value: Created) { + RawCreatedChecklistTask.serializer().serialize( + encoder, + RawCreatedChecklistTask( + id = value.id, + text = value.text, + completedByUser = value.completedByUser, + completionDate = value.completionDate ?: TelegramDate(0), + textSources = value.textSources.toRawMessageEntities() + ) ) } } - - override fun serialize(encoder: Encoder, value: ChecklistTask) { - RawChecklistTask.serializer().serialize( - encoder, - RawChecklistTask( - id = value.id, - text = value.text, - completedByUser = value.completedByUser, - completionDate = value.completionDate ?: TelegramDate(0), - textSources = value.textSources.toRawMessageEntities() - ) - ) - } } } \ No newline at end of file diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/ChecklistTaskId.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/ChecklistTaskId.kt index 3d50703dc4..c5df6abd6a 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/ChecklistTaskId.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/ChecklistTaskId.kt @@ -6,5 +6,5 @@ import kotlin.jvm.JvmInline @Serializable @JvmInline value class ChecklistTaskId( - val int: Int + val int: UInt ) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/InputChecklist.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/InputChecklist.kt new file mode 100644 index 0000000000..1baf755a5f --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/InputChecklist.kt @@ -0,0 +1,15 @@ +package dev.inmo.tgbotapi.types.checklists + +import dev.inmo.micro_utils.common.Warning +import dev.inmo.tgbotapi.abstracts.TextedInput +import dev.inmo.tgbotapi.abstracts.TitledInput +import dev.inmo.tgbotapi.types.message.ParseMode +import dev.inmo.tgbotapi.types.message.parseModeField +import dev.inmo.tgbotapi.types.message.textsources.TextSource +import dev.inmo.tgbotapi.types.tasksField +import dev.inmo.tgbotapi.types.titleEntitiesField +import dev.inmo.tgbotapi.types.titleField +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + + From ff781535914aa99fc0deaebd7ecec71a03bf4751 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Mon, 7 Jul 2025 15:18:22 +0600 Subject: [PATCH 05/16] small improvements --- .../dev/inmo/tgbotapi/types/checklists/Checklist.kt | 7 +++++++ .../inmo/tgbotapi/types/checklists/ChecklistTask.kt | 12 ------------ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/Checklist.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/Checklist.kt index e8e9751ddd..9746b6821f 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/Checklist.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/Checklist.kt @@ -8,6 +8,8 @@ import dev.inmo.tgbotapi.types.message.asTextSources import dev.inmo.tgbotapi.types.message.parseModeField import dev.inmo.tgbotapi.types.message.textsources.TextSource import dev.inmo.tgbotapi.types.message.toRawMessageEntities +import dev.inmo.tgbotapi.types.othersCanAddTasksField +import dev.inmo.tgbotapi.types.othersCanMarkTasksAsDoneField import dev.inmo.tgbotapi.types.tasksField import dev.inmo.tgbotapi.types.titleEntitiesField import dev.inmo.tgbotapi.types.titleField @@ -34,7 +36,9 @@ sealed interface Checklist : TitledInput { val parseMode: ParseMode? = null, @SerialName(titleEntitiesField) override val titleTextSources: List = emptyList(), + @SerialName(othersCanAddTasksField) override val othersCanAddTasks: Boolean = false, + @SerialName(othersCanMarkTasksAsDoneField) override val othersCanCompleteTasks: Boolean = false, ) : Checklist { companion object : KSerializer { @@ -83,8 +87,11 @@ sealed interface Checklist : TitledInput { @Serializable(Created.Companion::class) data class Created( override val titleTextSources: List, + @SerialName(tasksField) override val tasks: List, + @SerialName(othersCanAddTasksField) override val othersCanAddTasks: Boolean = false, + @SerialName(othersCanMarkTasksAsDoneField) override val othersCanCompleteTasks: Boolean = false, ): Checklist { override val title: String by lazy { diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/ChecklistTask.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/ChecklistTask.kt index 71702f07a7..d587b4ff40 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/ChecklistTask.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/ChecklistTask.kt @@ -38,18 +38,6 @@ import kotlinx.serialization.encoding.Encoder sealed interface ChecklistTask : TextedInput { val id: ChecklistTaskId override val text: String - @Serializable - data class InputChecklist @Warning("It is low level API. Do not use it without need") constructor( - @SerialName(titleField) - override val title: String, - @SerialName(tasksField) - val tasks: List, - @SerialName(parseModeField) - val parseMode: ParseMode? = null, - @SerialName(titleEntitiesField) - override val titleTextSources: List = emptyList(), - - ) : TitledInput @Serializable(Input.Companion::class) data class Input @Warning("It is low level API. Do not use it without need") constructor( From dd2923f92d9cbf3a77f0aa2d0aa06ad6ca22ecf1 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Mon, 7 Jul 2025 15:39:48 +0600 Subject: [PATCH 06/16] complete base checklists? --- .../tgbotapi/types/checklists/Checklist.kt | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/Checklist.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/Checklist.kt index 9746b6821f..29cf823fcd 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/Checklist.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/Checklist.kt @@ -2,6 +2,7 @@ package dev.inmo.tgbotapi.types.checklists import dev.inmo.micro_utils.common.Warning import dev.inmo.tgbotapi.abstracts.TitledInput +import dev.inmo.tgbotapi.types.checklists.ChecklistTask.Input import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.RawMessageEntity import dev.inmo.tgbotapi.types.message.asTextSources @@ -13,6 +14,8 @@ import dev.inmo.tgbotapi.types.othersCanMarkTasksAsDoneField import dev.inmo.tgbotapi.types.tasksField import dev.inmo.tgbotapi.types.titleEntitiesField import dev.inmo.tgbotapi.types.titleField +import dev.inmo.tgbotapi.utils.EntitiesBuilder +import dev.inmo.tgbotapi.utils.EntitiesBuilderBody import dev.inmo.tgbotapi.utils.extensions.makeSourceString import kotlinx.serialization.KSerializer import kotlinx.serialization.SerialName @@ -41,6 +44,45 @@ sealed interface Checklist : TitledInput { @SerialName(othersCanMarkTasksAsDoneField) override val othersCanCompleteTasks: Boolean = false, ) : Checklist { + constructor( + text: String, + tasks: List, + parseMode: ParseMode? = null, + othersCanAddTasks: Boolean = false, + othersCanCompleteTasks: Boolean = false, + ) : this( + title = text, + parseMode = parseMode, + titleTextSources = emptyList(), + tasks = tasks, + othersCanAddTasks = othersCanAddTasks, + othersCanCompleteTasks = othersCanCompleteTasks + ) + constructor( + titleTextSources: List, + tasks: List, + othersCanAddTasks: Boolean = false, + othersCanCompleteTasks: Boolean = false, + ) : this( + title = titleTextSources.makeSourceString(), + parseMode = null, + titleTextSources = titleTextSources, + tasks = tasks, + othersCanAddTasks = othersCanAddTasks, + othersCanCompleteTasks = othersCanCompleteTasks + ) + constructor( + tasks: List, + othersCanAddTasks: Boolean = false, + othersCanCompleteTasks: Boolean = false, + builderBody: EntitiesBuilderBody + ) : this( + titleTextSources = EntitiesBuilder().apply(builderBody).build(), + tasks = tasks, + othersCanAddTasks = othersCanAddTasks, + othersCanCompleteTasks = othersCanCompleteTasks + ) + companion object : KSerializer { @Serializable private class RawChecklist( From 71ccfc88cc7184619ecde3db9fa4036d14851ab2 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Mon, 7 Jul 2025 16:25:21 +0600 Subject: [PATCH 07/16] start add SendChecklist --- .../tgbotapi/requests/send/SendChecklist.kt | 75 +++++++++++++++++++ .../kotlin/dev/inmo/tgbotapi/types/Common.kt | 1 + .../inmo/tgbotapi/types/message/RawMessage.kt | 4 + .../types/message/content/ChecklistContent.kt | 32 ++++++++ 4 files changed, 112 insertions(+) create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/SendChecklist.kt create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/ChecklistContent.kt diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/SendChecklist.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/SendChecklist.kt new file mode 100644 index 0000000000..63012d5fef --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/SendChecklist.kt @@ -0,0 +1,75 @@ +package dev.inmo.tgbotapi.requests.send + +import dev.inmo.tgbotapi.abstracts.types.AllowPaidBroadcast +import dev.inmo.tgbotapi.abstracts.types.DisableNotification +import dev.inmo.tgbotapi.abstracts.types.OptionallyWithEffectId +import dev.inmo.tgbotapi.abstracts.types.ProtectContent +import dev.inmo.tgbotapi.abstracts.types.WithBusinessConnectionId +import dev.inmo.tgbotapi.abstracts.types.WithReplyMarkup +import dev.inmo.tgbotapi.abstracts.types.WithReplyParameters +import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyMessageThreadRequest +import dev.inmo.tgbotapi.requests.send.abstracts.SendChatMessageRequest +import dev.inmo.tgbotapi.requests.send.abstracts.SendContentMessageRequest +import dev.inmo.tgbotapi.types.* +import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId +import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup +import dev.inmo.tgbotapi.types.checklists.Checklist +import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage +import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass +import dev.inmo.tgbotapi.types.message.content.ChecklistContent +import dev.inmo.tgbotapi.types.message.content.GameContent +import kotlinx.serialization.* + +private val commonResultDeserializer: DeserializationStrategy> + = TelegramBotAPIMessageDeserializationStrategyClass() + +@Serializable +data class SendChecklist ( + @SerialName(chatIdField) + override val chatId: ChatIdentifier, + @SerialName(checklistField) + val checklist: Checklist.Input, + @SerialName(businessConnectionIdField) + override val businessConnectionId: BusinessConnectionId, + @SerialName(disableNotificationField) + override val disableNotification: Boolean = false, + @SerialName(protectContentField) + override val protectContent: Boolean = false, + @SerialName(messageEffectIdField) + override val effectId: EffectId? = null, + @SerialName(replyParametersField) + override val replyParameters: ReplyParameters? = null, + @SerialName(replyMarkupField) + override val replyMarkup: KeyboardMarkup? = null +) : SendChatMessageRequest>, + WithReplyParameters, + DisableNotification, + ProtectContent, + OptionallyWithEffectId, + WithBusinessConnectionId, + WithReplyMarkup { + constructor( + chatId: BusinessChatId, + checklist: Checklist.Input, + disableNotification: Boolean = false, + protectContent: Boolean = false, + effectId: EffectId? = null, + replyParameters: ReplyParameters? = null, + replyMarkup: KeyboardMarkup? = null + ) : this( + chatId = chatId, + checklist = checklist, + businessConnectionId = chatId.businessConnectionId, + disableNotification = disableNotification, + protectContent = protectContent, + effectId = effectId, + replyParameters = replyParameters, + replyMarkup = replyMarkup + ) + + override fun method(): String = "sendChecklist" + override val resultDeserializer: DeserializationStrategy> + get() = commonResultDeserializer + override val requestSerializer: SerializationStrategy<*> + get() = serializer() +} diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt index 8bf51d5140..ff50ef8bfd 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt @@ -314,6 +314,7 @@ const val titleEntitiesField = "title_entities" const val tasksField = "tasks" const val othersCanAddTasksField = "others_can_add_tasks" const val othersCanMarkTasksAsDoneField = "others_can_mark_tasks_as_done" +const val checklistField = "checklist" const val requestContactField = "request_contact" const val requestLocationField = "request_location" 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 41492d95fc..12e9200922 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 @@ -165,6 +165,10 @@ internal data class RawMessage( private val giveaway_winners: GiveawayPublicResults? = null, private val giveaway_completed: GiveawayPrivateResults? = null, + // Checklists + private val checklist_tasks_done: Nothing, + private val checklist_tasks_added: Nothing, + // Gifts private val gift: GiftSentOrReceived.Regular? = null, private val unique_gift: GiftSentOrReceived.Unique? = null, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/ChecklistContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/ChecklistContent.kt new file mode 100644 index 0000000000..45ae90a46a --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/ChecklistContent.kt @@ -0,0 +1,32 @@ +package dev.inmo.tgbotapi.types.message.content + +import dev.inmo.tgbotapi.requests.abstracts.Request +import dev.inmo.tgbotapi.types.ChatIdentifier +import dev.inmo.tgbotapi.types.EffectId +import dev.inmo.tgbotapi.types.MessageThreadId +import dev.inmo.tgbotapi.types.ReplyParameters +import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId +import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup +import dev.inmo.tgbotapi.types.checklists.Checklist +import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage +import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage +import kotlinx.serialization.Serializable + +@Serializable +data class ChecklistContent( + val checklist: Checklist +) : MessageContent { + override fun createResend( + chatId: ChatIdentifier, + messageThreadId: MessageThreadId?, + businessConnectionId: BusinessConnectionId?, + disableNotification: Boolean, + protectContent: Boolean, + allowPaidBroadcast: Boolean, + effectId: EffectId?, + replyParameters: ReplyParameters?, + replyMarkup: KeyboardMarkup? + ): Request> { + return SendChecklist + } +} From e53b3b81980d212f4651a7526b24ab8353a50dd6 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Mon, 7 Jul 2025 20:55:38 +0600 Subject: [PATCH 08/16] improve support of send checklist --- tgbotapi.api/api/tgbotapi.api.api | 23 ++ .../tgbotapi/extensions/api/send/Replies.kt | 87 +++++ .../api/send/RepliesWithChatsAndMessages.kt | 56 +++ .../extensions/api/send/SendChecklist.kt | 54 +++ .../tgbotapi/extensions/api/send/Sends.kt | 46 +++ tgbotapi.core/api/tgbotapi.core.api | 336 ++++++++++++++++++ .../types/message/content/ChecklistContent.kt | 28 +- tgbotapi.utils/api/tgbotapi.utils.api | 3 + .../extensions/utils/ClassCastsNew.kt | 10 + 9 files changed, 640 insertions(+), 3 deletions(-) create mode 100644 tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendChecklist.kt diff --git a/tgbotapi.api/api/tgbotapi.api.api b/tgbotapi.api/api/tgbotapi.api.api index 591577b890..469b04af7a 100644 --- a/tgbotapi.api/api/tgbotapi.api.api +++ b/tgbotapi.api/api/tgbotapi.api.api @@ -1319,6 +1319,8 @@ public final class dev/inmo/tgbotapi/extensions/api/send/RepliesKt { public static synthetic fun reply-ETv3X88$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Ldev/inmo/tgbotapi/types/files/VideoFile;Ljava/util/List;ZZLdev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static final fun reply-Ff7hz4g (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Ldev/inmo/tgbotapi/types/polls/QuizPoll;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;IZZLdev/inmo/tgbotapi/types/message/ParseMode;Ldev/inmo/tgbotapi/types/message/ParseMode;Ldev/inmo/tgbotapi/types/polls/ScheduledCloseInfo;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static synthetic fun reply-Ff7hz4g$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Ldev/inmo/tgbotapi/types/polls/QuizPoll;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;IZZLdev/inmo/tgbotapi/types/message/ParseMode;Ldev/inmo/tgbotapi/types/message/ParseMode;Ldev/inmo/tgbotapi/types/polls/ScheduledCloseInfo;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final fun reply-Fsp7mzg (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/BusinessContentMessage;Ldev/inmo/tgbotapi/types/checklists/Checklist$Input;Ldev/inmo/tgbotapi/types/IdChatIdentifier;ZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun reply-Fsp7mzg$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/BusinessContentMessage;Ldev/inmo/tgbotapi/types/checklists/Checklist$Input;Ldev/inmo/tgbotapi/types/IdChatIdentifier;ZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static final fun reply-Ke6Xk7g (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;DDLdev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun reply-Ke6Xk7g (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Ldev/inmo/tgbotapi/types/files/Sticker;Ljava/lang/String;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun reply-Ke6Xk7g (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Ldev/inmo/tgbotapi/types/files/VoiceFile;Ljava/util/List;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -1337,6 +1339,8 @@ public final class dev/inmo/tgbotapi/extensions/api/send/RepliesKt { public static synthetic fun reply-TJcuzHc$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Ljava/lang/String;Ldev/inmo/tgbotapi/types/LinkPreviewOptions;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static final fun reply-TW0iyVw (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ljava/lang/Integer;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;ZZZZZZZLdev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;ZZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static synthetic fun reply-TW0iyVw$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ljava/lang/Integer;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;ZZZZZZZLdev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;ZZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final fun reply-UjZzIww (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Ljava/lang/String;Ldev/inmo/tgbotapi/types/checklists/Checklist$Input;Ldev/inmo/tgbotapi/types/IdChatIdentifier;ZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun reply-UjZzIww$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Ljava/lang/String;Ldev/inmo/tgbotapi/types/checklists/Checklist$Input;Ldev/inmo/tgbotapi/types/IdChatIdentifier;ZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static final fun reply-XYAUcks (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/payments/LabeledPrice;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;ZZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static synthetic fun reply-XYAUcks$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/payments/LabeledPrice;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;ZZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static final fun reply-Y21khHA (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Ljava/util/List;Ljava/util/List;ZZLdev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -1393,6 +1397,10 @@ public final class dev/inmo/tgbotapi/extensions/api/send/RepliesKt { public static synthetic fun replyWithAudio-2mDteE4$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static final fun replyWithAudio-qttyOhY (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/util/List;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static synthetic fun replyWithAudio-qttyOhY$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/util/List;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final fun replyWithChecklist-Fsp7mzg (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/BusinessContentMessage;Ldev/inmo/tgbotapi/types/checklists/Checklist$Input;Ldev/inmo/tgbotapi/types/IdChatIdentifier;ZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun replyWithChecklist-Fsp7mzg$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/BusinessContentMessage;Ldev/inmo/tgbotapi/types/checklists/Checklist$Input;Ldev/inmo/tgbotapi/types/IdChatIdentifier;ZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final fun replyWithChecklist-UjZzIww (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Ljava/lang/String;Ldev/inmo/tgbotapi/types/checklists/Checklist$Input;Ldev/inmo/tgbotapi/types/IdChatIdentifier;ZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun replyWithChecklist-UjZzIww$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Ljava/lang/String;Ldev/inmo/tgbotapi/types/checklists/Checklist$Input;Ldev/inmo/tgbotapi/types/IdChatIdentifier;ZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static final fun replyWithDice-1DTOFHo (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Ldev/inmo/tgbotapi/types/dice/DiceAnimationType;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static synthetic fun replyWithDice-1DTOFHo$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Ldev/inmo/tgbotapi/types/dice/DiceAnimationType;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static final fun replyWithDocument-3s1eNd0 (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Ljava/lang/Boolean;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -1472,6 +1480,8 @@ public final class dev/inmo/tgbotapi/extensions/api/send/RepliesWithChatsAndMess public static synthetic fun reply-Lf4znJU$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/IdChatIdentifier;JLdev/inmo/tgbotapi/types/files/VoiceFile;Ljava/util/List;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun reply-Lf4znJU$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/IdChatIdentifier;JLdev/inmo/tgbotapi/types/message/content/TextedMediaContent;Ljava/util/List;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun reply-Lf4znJU$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/IdChatIdentifier;JLjava/util/List;Ldev/inmo/tgbotapi/types/LinkPreviewOptions;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final fun reply-NqYE4-Y (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/IdChatIdentifier;JLjava/lang/String;Ldev/inmo/tgbotapi/types/checklists/Checklist$Input;Ldev/inmo/tgbotapi/types/IdChatIdentifier;ZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun reply-NqYE4-Y$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/IdChatIdentifier;JLjava/lang/String;Ldev/inmo/tgbotapi/types/checklists/Checklist$Input;Ldev/inmo/tgbotapi/types/IdChatIdentifier;ZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static final fun reply-PEnUfdE (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/IdChatIdentifier;JLdev/inmo/tgbotapi/types/files/AnimationFile;Ljava/util/List;ZZLjava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun reply-PEnUfdE (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/IdChatIdentifier;JLdev/inmo/tgbotapi/types/location/StaticLocation;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun reply-PEnUfdE (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/IdChatIdentifier;JLdev/inmo/tgbotapi/types/polls/RegularPoll;Ljava/util/List;Ljava/util/List;ZZZLdev/inmo/tgbotapi/types/polls/ScheduledCloseInfo;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -1550,6 +1560,8 @@ public final class dev/inmo/tgbotapi/extensions/api/send/RepliesWithChatsAndMess public static synthetic fun replyWithAudio-PEnUfdE$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/IdChatIdentifier;JLdev/inmo/tgbotapi/requests/abstracts/InputFile;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static final fun replyWithAudio-jTbypQk (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/IdChatIdentifier;JLdev/inmo/tgbotapi/requests/abstracts/InputFile;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/util/List;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static synthetic fun replyWithAudio-jTbypQk$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/IdChatIdentifier;JLdev/inmo/tgbotapi/requests/abstracts/InputFile;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/util/List;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final fun replyWithChecklist-NqYE4-Y (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/IdChatIdentifier;JLjava/lang/String;Ldev/inmo/tgbotapi/types/checklists/Checklist$Input;Ldev/inmo/tgbotapi/types/IdChatIdentifier;ZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun replyWithChecklist-NqYE4-Y$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/IdChatIdentifier;JLjava/lang/String;Ldev/inmo/tgbotapi/types/checklists/Checklist$Input;Ldev/inmo/tgbotapi/types/IdChatIdentifier;ZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static final fun replyWithDice-PVBa9oU (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/IdChatIdentifier;JLdev/inmo/tgbotapi/types/dice/DiceAnimationType;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static synthetic fun replyWithDice-PVBa9oU$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/IdChatIdentifier;JLdev/inmo/tgbotapi/types/dice/DiceAnimationType;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static final fun replyWithDocument-COsZUog (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/IdChatIdentifier;JLdev/inmo/tgbotapi/requests/abstracts/InputFile;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Ljava/lang/Boolean;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -1698,6 +1710,13 @@ public final class dev/inmo/tgbotapi/extensions/api/send/SendActionKt { public static synthetic fun sendBotAction-tTqYV0E$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/Chat;Ldev/inmo/tgbotapi/types/actions/BotAction;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; } +public final class dev/inmo/tgbotapi/extensions/api/send/SendChecklistKt { + public static final fun sendChecklist-6LFavEk (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/checklists/Checklist$Input;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun sendChecklist-6LFavEk$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/checklists/Checklist$Input;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final fun sendChecklist-mTQpBzk (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlin/Pair;Ldev/inmo/tgbotapi/types/checklists/Checklist$Input;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun sendChecklist-mTQpBzk$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlin/Pair;Ldev/inmo/tgbotapi/types/checklists/Checklist$Input;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; +} + public final class dev/inmo/tgbotapi/extensions/api/send/SendContactKt { public static final fun sendContact--hE6nj8 (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/Contact;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun sendContact--hE6nj8 (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/Chat;Ldev/inmo/tgbotapi/types/Contact;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -1867,6 +1886,8 @@ public final class dev/inmo/tgbotapi/extensions/api/send/SendsKt { public static synthetic fun send-2mDteE4$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/Chat;Ljava/lang/String;Ljava/util/List;ILjava/util/List;Ldev/inmo/tgbotapi/types/message/ParseMode;ZZLdev/inmo/tgbotapi/types/polls/ScheduledCloseInfo;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun send-2mDteE4$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/Chat;Ljava/util/List;Ljava/util/List;IZZLjava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ldev/inmo/tgbotapi/types/polls/ScheduledCloseInfo;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun send-2mDteE4$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/Chat;ZLdev/inmo/tgbotapi/types/polls/QuizPoll;Ljava/util/List;Ljava/util/List;Ljava/util/List;IZLdev/inmo/tgbotapi/types/polls/ScheduledCloseInfo;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final fun send-6LFavEk (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/checklists/Checklist$Input;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun send-6LFavEk$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/checklists/Checklist$Input;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static final fun send-CoeeeEM (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/files/AudioFile;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/lang/String;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun send-CoeeeEM (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/files/PhotoSize;Ljava/util/List;ZZLdev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun send-CoeeeEM (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/files/VideoFile;Ljava/util/List;ZZLdev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -1959,6 +1980,8 @@ public final class dev/inmo/tgbotapi/extensions/api/send/SendsKt { public static final fun send-k7KSHg8 (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/Chat;Ljava/util/List;Ljava/util/List;ZZLdev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static synthetic fun send-k7KSHg8$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;Ljava/util/List;Ljava/util/List;ZZLdev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun send-k7KSHg8$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/Chat;Ljava/util/List;Ljava/util/List;ZZLdev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final fun send-mTQpBzk (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlin/Pair;Ldev/inmo/tgbotapi/types/checklists/Checklist$Input;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun send-mTQpBzk$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlin/Pair;Ldev/inmo/tgbotapi/types/checklists/Checklist$Input;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static final fun send-qttyOhY (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/files/AnimationFile;Ljava/util/List;ZZLjava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun send-qttyOhY (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/location/StaticLocation;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun send-qttyOhY (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/polls/RegularPoll;Ljava/util/List;ZLjava/util/List;ZZLdev/inmo/tgbotapi/types/polls/ScheduledCloseInfo;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/Replies.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/Replies.kt index c87db41a27..a7c3bc91da 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/Replies.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/Replies.kt @@ -17,6 +17,7 @@ import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat +import dev.inmo.tgbotapi.types.checklists.Checklist import dev.inmo.tgbotapi.types.dice.DiceAnimationType import dev.inmo.tgbotapi.types.files.* import dev.inmo.tgbotapi.types.files.TelegramMediaFile @@ -24,6 +25,7 @@ import dev.inmo.tgbotapi.types.files.Sticker import dev.inmo.tgbotapi.types.games.Game import dev.inmo.tgbotapi.types.location.* import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage +import dev.inmo.tgbotapi.types.message.abstracts.BusinessContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.content.* import dev.inmo.tgbotapi.types.message.textsources.TextSource @@ -164,6 +166,91 @@ public suspend inline fun TelegramBot.reply( ) +// Checklist + +public suspend inline fun TelegramBot.replyWithChecklist( + to: AccessibleMessage, + replyInBusinessConnectionId: BusinessConnectionId, + checklist: Checklist.Input, + replyInChatId: IdChatIdentifier = to.chat.id, + disableNotification: Boolean = false, + protectContent: Boolean = false, + effectId: EffectId? = null, + allowSendingWithoutReply: Boolean? = null, + replyMarkup: KeyboardMarkup? = null +): ContentMessage = sendChecklist( + chatId = replyInChatId, + checklist = checklist, + businessConnectionId = replyInBusinessConnectionId, + disableNotification = disableNotification, + protectContent = protectContent, + effectId = effectId, + replyParameters = ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), + replyMarkup = replyMarkup +) + +public suspend inline fun TelegramBot.replyWithChecklist( + to: BusinessContentMessage<*>, + checklist: Checklist.Input, + replyInChatId: IdChatIdentifier = to.chat.id, + disableNotification: Boolean = false, + protectContent: Boolean = false, + effectId: EffectId? = null, + allowSendingWithoutReply: Boolean? = null, + replyMarkup: KeyboardMarkup? = null +): ContentMessage = sendChecklist( + chatId = replyInChatId, + checklist = checklist, + businessConnectionId = to.businessConnectionId, + disableNotification = disableNotification, + protectContent = protectContent, + effectId = effectId, + replyParameters = ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), + replyMarkup = replyMarkup +) + +public suspend inline fun TelegramBot.reply( + to: AccessibleMessage, + replyInBusinessConnectionId: BusinessConnectionId, + checklist: Checklist.Input, + replyInChatId: IdChatIdentifier = to.chat.id, + disableNotification: Boolean = false, + protectContent: Boolean = false, + effectId: EffectId? = null, + allowSendingWithoutReply: Boolean? = null, + replyMarkup: KeyboardMarkup? = null +): ContentMessage = sendChecklist( + chatId = replyInChatId, + checklist = checklist, + businessConnectionId = replyInBusinessConnectionId, + disableNotification = disableNotification, + protectContent = protectContent, + effectId = effectId, + replyParameters = ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), + replyMarkup = replyMarkup +) + +public suspend inline fun TelegramBot.reply( + to: BusinessContentMessage<*>, + checklist: Checklist.Input, + replyInChatId: IdChatIdentifier = to.chat.id, + disableNotification: Boolean = false, + protectContent: Boolean = false, + effectId: EffectId? = null, + allowSendingWithoutReply: Boolean? = null, + replyMarkup: KeyboardMarkup? = null +): ContentMessage = sendChecklist( + chatId = replyInChatId, + checklist = checklist, + businessConnectionId = to.businessConnectionId, + disableNotification = disableNotification, + protectContent = protectContent, + effectId = effectId, + replyParameters = ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), + replyMarkup = replyMarkup +) + + // Location /** diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/RepliesWithChatsAndMessages.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/RepliesWithChatsAndMessages.kt index 67502df617..29e58e88fc 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/RepliesWithChatsAndMessages.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/RepliesWithChatsAndMessages.kt @@ -18,6 +18,7 @@ import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat +import dev.inmo.tgbotapi.types.checklists.Checklist import dev.inmo.tgbotapi.types.dice.DiceAnimationType import dev.inmo.tgbotapi.types.files.* import dev.inmo.tgbotapi.types.files.TelegramMediaFile @@ -169,6 +170,61 @@ public suspend inline fun TelegramBot.reply( ) +// Checklist + +/** + * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or + * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param + */ +public suspend inline fun TelegramBot.replyWithChecklist( + toChatId: IdChatIdentifier, + toMessageId: MessageId, + replyInBusinessConnectionId: BusinessConnectionId, + checklist: Checklist.Input, + replyInChatId: IdChatIdentifier = toChatId, + disableNotification: Boolean = false, + protectContent: Boolean = false, + effectId: EffectId? = null, + allowSendingWithoutReply: Boolean? = null, + replyMarkup: KeyboardMarkup? = null +): ContentMessage = sendChecklist( + chatId = replyInChatId, + checklist = checklist, + businessConnectionId = replyInBusinessConnectionId, + disableNotification = disableNotification, + protectContent = protectContent, + effectId = effectId, + replyParameters = ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), + replyMarkup = replyMarkup +) + +/** + * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or + * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param + */ +public suspend inline fun TelegramBot.reply( + toChatId: IdChatIdentifier, + toMessageId: MessageId, + replyInBusinessConnectionId: BusinessConnectionId, + checklist: Checklist.Input, + replyInChatId: IdChatIdentifier = toChatId, + disableNotification: Boolean = false, + protectContent: Boolean = false, + effectId: EffectId? = null, + allowSendingWithoutReply: Boolean? = null, + replyMarkup: KeyboardMarkup? = null +): ContentMessage = sendChecklist( + chatId = replyInChatId, + checklist = checklist, + businessConnectionId = replyInBusinessConnectionId, + disableNotification = disableNotification, + protectContent = protectContent, + effectId = effectId, + replyParameters = ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), + replyMarkup = replyMarkup +) + + // Location /** diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendChecklist.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendChecklist.kt new file mode 100644 index 0000000000..25c4f5d17a --- /dev/null +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendChecklist.kt @@ -0,0 +1,54 @@ +package dev.inmo.tgbotapi.extensions.api.send + +import dev.inmo.tgbotapi.bot.TelegramBot +import dev.inmo.tgbotapi.requests.send.SendChecklist +import dev.inmo.tgbotapi.types.BusinessChatId +import dev.inmo.tgbotapi.types.ChatIdentifier +import dev.inmo.tgbotapi.types.EffectId +import dev.inmo.tgbotapi.types.ReplyParameters +import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId +import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup +import dev.inmo.tgbotapi.types.checklists.Checklist + +public suspend fun TelegramBot.sendChecklist( + chatId: ChatIdentifier, + checklist: Checklist.Input, + businessConnectionId: BusinessConnectionId, + disableNotification: Boolean = false, + protectContent: Boolean = false, + effectId: EffectId? = null, + replyParameters: ReplyParameters? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendChecklist( + chatId = chatId, + checklist = checklist, + businessConnectionId = businessConnectionId, + disableNotification = disableNotification, + protectContent = protectContent, + effectId = effectId, + replyParameters = replyParameters, + replyMarkup = replyMarkup + ) +) + +public suspend fun TelegramBot.sendChecklist( + chatId: BusinessChatId, + checklist: Checklist.Input, + disableNotification: Boolean = false, + protectContent: Boolean = false, + effectId: EffectId? = null, + replyParameters: ReplyParameters? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendChecklist( + chatId = chatId, + checklist = checklist, + businessConnectionId = chatId.businessConnectionId, + disableNotification = disableNotification, + protectContent = protectContent, + effectId = effectId, + replyParameters = replyParameters, + replyMarkup = replyMarkup + ) +) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/Sends.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/Sends.kt index 91a3438591..7ee9a9bbb9 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/Sends.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/Sends.kt @@ -6,6 +6,7 @@ import dev.inmo.tgbotapi.extensions.api.send.media.* import dev.inmo.tgbotapi.extensions.api.send.payments.sendInvoice import dev.inmo.tgbotapi.extensions.api.send.polls.sendQuizPoll import dev.inmo.tgbotapi.extensions.api.send.polls.sendRegularPoll +import dev.inmo.tgbotapi.requests.send.SendChecklist import dev.inmo.tgbotapi.requests.send.media.rawSendingMediaGroupsWarning import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.actions.BotAction @@ -14,6 +15,7 @@ import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.chat.CommonUser +import dev.inmo.tgbotapi.types.checklists.Checklist import dev.inmo.tgbotapi.types.dice.DiceAnimationType import dev.inmo.tgbotapi.types.files.* import dev.inmo.tgbotapi.types.games.Game @@ -534,6 +536,50 @@ public suspend fun TelegramBot.send( replyMarkup = replyMarkup ) + +public suspend fun TelegramBot.send( + chatId: ChatIdentifier, + checklist: Checklist.Input, + businessConnectionId: BusinessConnectionId, + disableNotification: Boolean = false, + protectContent: Boolean = false, + effectId: EffectId? = null, + replyParameters: ReplyParameters? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendChecklist( + chatId = chatId, + checklist = checklist, + businessConnectionId = businessConnectionId, + disableNotification = disableNotification, + protectContent = protectContent, + effectId = effectId, + replyParameters = replyParameters, + replyMarkup = replyMarkup + ) +) + +public suspend fun TelegramBot.send( + chatId: BusinessChatId, + checklist: Checklist.Input, + disableNotification: Boolean = false, + protectContent: Boolean = false, + effectId: EffectId? = null, + replyParameters: ReplyParameters? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendChecklist( + chatId = chatId, + checklist = checklist, + businessConnectionId = chatId.businessConnectionId, + disableNotification = disableNotification, + protectContent = protectContent, + effectId = effectId, + replyParameters = replyParameters, + replyMarkup = replyMarkup + ) +) + /** * Will execute [sendDocument] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or diff --git a/tgbotapi.core/api/tgbotapi.core.api b/tgbotapi.core/api/tgbotapi.core.api index d9e75eb892..fbf3be29d4 100644 --- a/tgbotapi.core/api/tgbotapi.core.api +++ b/tgbotapi.core/api/tgbotapi.core.api @@ -134,6 +134,18 @@ public abstract interface class dev/inmo/tgbotapi/abstracts/Titled { public abstract fun getTitle ()Ljava/lang/String; } +public abstract interface class dev/inmo/tgbotapi/abstracts/TitledInput : dev/inmo/tgbotapi/abstracts/TextedInput { + public abstract fun getText ()Ljava/lang/String; + public abstract fun getTextSources ()Ljava/util/List; + public abstract fun getTitle ()Ljava/lang/String; + public abstract fun getTitleTextSources ()Ljava/util/List; +} + +public final class dev/inmo/tgbotapi/abstracts/TitledInput$DefaultImpls { + public static fun getText (Ldev/inmo/tgbotapi/abstracts/TitledInput;)Ljava/lang/String; + public static fun getTextSources (Ldev/inmo/tgbotapi/abstracts/TitledInput;)Ljava/util/List; +} + public abstract interface class dev/inmo/tgbotapi/abstracts/WithCustomStartMediaData { public abstract fun getStartTimestamp ()Ljava/lang/Integer; } @@ -5474,6 +5486,55 @@ public final class dev/inmo/tgbotapi/requests/send/SendAction$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } +public final class dev/inmo/tgbotapi/requests/send/SendChecklist : dev/inmo/tgbotapi/abstracts/types/DisableNotification, dev/inmo/tgbotapi/abstracts/types/OptionallyWithEffectId, dev/inmo/tgbotapi/abstracts/types/ProtectContent, dev/inmo/tgbotapi/abstracts/types/WithBusinessConnectionId, dev/inmo/tgbotapi/abstracts/types/WithReplyMarkup, dev/inmo/tgbotapi/abstracts/types/WithReplyParameters, dev/inmo/tgbotapi/requests/send/abstracts/SendChatMessageRequest { + public static final field Companion Ldev/inmo/tgbotapi/requests/send/SendChecklist$Companion; + public synthetic fun (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/checklists/Checklist$Input;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/checklists/Checklist$Input;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Lkotlin/Pair;Ldev/inmo/tgbotapi/types/checklists/Checklist$Input;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Lkotlin/Pair;Ldev/inmo/tgbotapi/types/checklists/Checklist$Input;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/ChatIdentifier; + public final fun component2 ()Ldev/inmo/tgbotapi/types/checklists/Checklist$Input; + public final fun component3-T-_HSQI ()Ljava/lang/String; + public final fun component4 ()Z + public final fun component5 ()Z + public final fun component6-Ts0V7ak ()Ljava/lang/String; + public final fun component7 ()Ldev/inmo/tgbotapi/types/ReplyParameters; + public final fun component8 ()Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup; + public final fun copy-4oVOAy8 (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/checklists/Checklist$Input;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;)Ldev/inmo/tgbotapi/requests/send/SendChecklist; + public static synthetic fun copy-4oVOAy8$default (Ldev/inmo/tgbotapi/requests/send/SendChecklist;Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/checklists/Checklist$Input;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;ILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/send/SendChecklist; + public fun equals (Ljava/lang/Object;)Z + public fun getAllowSendingWithoutReply ()Ljava/lang/Boolean; + public fun getBusinessConnectionId-T-_HSQI ()Ljava/lang/String; + public synthetic fun getBusinessConnectionId-nXr5wdE ()Ljava/lang/String; + public fun getChatId ()Ldev/inmo/tgbotapi/types/ChatIdentifier; + public final fun getChecklist ()Ldev/inmo/tgbotapi/types/checklists/Checklist$Input; + public fun getDisableNotification ()Z + public fun getEffectId-Ts0V7ak ()Ljava/lang/String; + public fun getProtectContent ()Z + public fun getReplyMarkup ()Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup; + public fun getReplyParameters ()Ldev/inmo/tgbotapi/types/ReplyParameters; + public fun getReplyToMessageId-CigXjpw ()Ldev/inmo/tgbotapi/types/MessageId; + public fun getRequestSerializer ()Lkotlinx/serialization/SerializationStrategy; + public fun getResultDeserializer ()Lkotlinx/serialization/DeserializationStrategy; + public fun hashCode ()I + public fun method ()Ljava/lang/String; + public fun toString ()Ljava/lang/String; +} + +public synthetic class dev/inmo/tgbotapi/requests/send/SendChecklist$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/requests/send/SendChecklist$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/requests/send/SendChecklist; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/requests/send/SendChecklist;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V +} + +public final class dev/inmo/tgbotapi/requests/send/SendChecklist$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + public final class dev/inmo/tgbotapi/requests/send/SendContact : dev/inmo/tgbotapi/requests/send/abstracts/ReplyingMarkupSendMessageRequest, dev/inmo/tgbotapi/requests/send/abstracts/SendContentMessageRequest { public static final field Companion Ldev/inmo/tgbotapi/requests/send/SendContact$Companion; public synthetic fun (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/Contact;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;ILkotlin/jvm/internal/DefaultConstructorMarker;)V @@ -9693,12 +9754,15 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field chatIsForumField Ljava/lang/String; public static final field chatTypeField Ljava/lang/String; public static final field chatsField Ljava/lang/String; + public static final field checklistField Ljava/lang/String; public static final field cityField Ljava/lang/String; public static final field closeDateField Ljava/lang/String; public static final field closingMinuteField Ljava/lang/String; public static final field colorField Ljava/lang/String; public static final field colorsField Ljava/lang/String; public static final field commissionPerMilleField Ljava/lang/String; + public static final field completedByUserField Ljava/lang/String; + public static final field completionDateField Ljava/lang/String; public static final field containsMasksField Ljava/lang/String; public static final field contentField Ljava/lang/String; public static final field convertStarCountField Ljava/lang/String; @@ -9920,6 +9984,8 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field optionsField Ljava/lang/String; public static final field orderInfoField Ljava/lang/String; public static final field originField Ljava/lang/String; + public static final field othersCanAddTasksField Ljava/lang/String; + public static final field othersCanMarkTasksAsDoneField Ljava/lang/String; public static final field ownedGiftIdField Ljava/lang/String; public static final field paidMediaField Ljava/lang/String; public static final field paidMediaPayloadField Ljava/lang/String; @@ -10075,6 +10141,7 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field switchPmTextField Ljava/lang/String; public static final field symbolColorField Ljava/lang/String; public static final field symbolField Ljava/lang/String; + public static final field tasksField Ljava/lang/String; public static final field telegramPaymentChargeIdField Ljava/lang/String; public static final field temperatureField Ljava/lang/String; public static final field temporaryRegistrationField Ljava/lang/String; @@ -10091,6 +10158,7 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field thumbnailUrlField Ljava/lang/String; public static final field thumbnailWidthField Ljava/lang/String; public static final field timeZoneNameField Ljava/lang/String; + public static final field titleEntitiesField Ljava/lang/String; public static final field titleField Ljava/lang/String; public static final field topColorField Ljava/lang/String; public static final field totalAmountField Ljava/lang/String; @@ -17590,6 +17658,246 @@ public final class dev/inmo/tgbotapi/types/chat/member/SubscriptionMemberChatMem public final fun serializer ()Lkotlinx/serialization/KSerializer; } +public abstract interface class dev/inmo/tgbotapi/types/checklists/Checklist : dev/inmo/tgbotapi/abstracts/TitledInput { + public static final field Companion Ldev/inmo/tgbotapi/types/checklists/Checklist$Companion; + public abstract fun getOthersCanAddTasks ()Z + public abstract fun getOthersCanCompleteTasks ()Z + public abstract fun getTasks ()Ljava/util/List; +} + +public final class dev/inmo/tgbotapi/types/checklists/Checklist$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/checklists/Checklist$Created : dev/inmo/tgbotapi/types/checklists/Checklist { + public static final field Companion Ldev/inmo/tgbotapi/types/checklists/Checklist$Created$Companion; + public fun (Ljava/util/List;Ljava/util/List;ZZ)V + public synthetic fun (Ljava/util/List;Ljava/util/List;ZZILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/util/List; + public final fun component2 ()Ljava/util/List; + public final fun component3 ()Z + public final fun component4 ()Z + public final fun copy (Ljava/util/List;Ljava/util/List;ZZ)Ldev/inmo/tgbotapi/types/checklists/Checklist$Created; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/checklists/Checklist$Created;Ljava/util/List;Ljava/util/List;ZZILjava/lang/Object;)Ldev/inmo/tgbotapi/types/checklists/Checklist$Created; + public fun equals (Ljava/lang/Object;)Z + public fun getOthersCanAddTasks ()Z + public fun getOthersCanCompleteTasks ()Z + public fun getTasks ()Ljava/util/List; + public fun getText ()Ljava/lang/String; + public fun getTextSources ()Ljava/util/List; + public fun getTitle ()Ljava/lang/String; + public fun getTitleTextSources ()Ljava/util/List; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final class dev/inmo/tgbotapi/types/checklists/Checklist$Created$Companion : kotlinx/serialization/KSerializer { + public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/checklists/Checklist$Created; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/checklists/Checklist$Created;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/checklists/Checklist$DefaultImpls { + public static fun getText (Ldev/inmo/tgbotapi/types/checklists/Checklist;)Ljava/lang/String; + public static fun getTextSources (Ldev/inmo/tgbotapi/types/checklists/Checklist;)Ljava/util/List; +} + +public final class dev/inmo/tgbotapi/types/checklists/Checklist$Input : dev/inmo/tgbotapi/types/checklists/Checklist { + public static final field Companion Ldev/inmo/tgbotapi/types/checklists/Checklist$Input$Companion; + public fun (Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/util/List;ZZ)V + public synthetic fun (Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/util/List;ZZILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun (Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/message/ParseMode;ZZ)V + public synthetic fun (Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/message/ParseMode;ZZILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun (Ljava/util/List;Ljava/util/List;ZZ)V + public synthetic fun (Ljava/util/List;Ljava/util/List;ZZILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun (Ljava/util/List;ZZLkotlin/jvm/functions/Function1;)V + public synthetic fun (Ljava/util/List;ZZLkotlin/jvm/functions/Function1;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component2 ()Ljava/util/List; + public final fun component3 ()Ldev/inmo/tgbotapi/types/message/ParseMode; + public final fun component4 ()Ljava/util/List; + public final fun component5 ()Z + public final fun component6 ()Z + public final fun copy (Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/util/List;ZZ)Ldev/inmo/tgbotapi/types/checklists/Checklist$Input; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/checklists/Checklist$Input;Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/util/List;ZZILjava/lang/Object;)Ldev/inmo/tgbotapi/types/checklists/Checklist$Input; + public fun equals (Ljava/lang/Object;)Z + public fun getOthersCanAddTasks ()Z + public fun getOthersCanCompleteTasks ()Z + public final fun getParseMode ()Ldev/inmo/tgbotapi/types/message/ParseMode; + public fun getTasks ()Ljava/util/List; + public fun getText ()Ljava/lang/String; + public fun getTextSources ()Ljava/util/List; + public fun getTitle ()Ljava/lang/String; + public fun getTitleTextSources ()Ljava/util/List; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class dev/inmo/tgbotapi/types/checklists/Checklist$Input$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/checklists/Checklist$Input$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/checklists/Checklist$Input; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/checklists/Checklist$Input;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V +} + +public final class dev/inmo/tgbotapi/types/checklists/Checklist$Input$Companion : kotlinx/serialization/KSerializer { + public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/checklists/Checklist$Input; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/checklists/Checklist$Input;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public abstract interface class dev/inmo/tgbotapi/types/checklists/ChecklistTask : dev/inmo/tgbotapi/abstracts/TextedInput { + public static final field Companion Ldev/inmo/tgbotapi/types/checklists/ChecklistTask$Companion; + public abstract fun getId-9XrXEx4 ()I + public abstract fun getText ()Ljava/lang/String; +} + +public final class dev/inmo/tgbotapi/types/checklists/ChecklistTask$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public abstract interface class dev/inmo/tgbotapi/types/checklists/ChecklistTask$Created : dev/inmo/tgbotapi/types/checklists/ChecklistTask { + public static final field Companion Ldev/inmo/tgbotapi/types/checklists/ChecklistTask$Created$Companion; + public abstract fun getCompletedByUser ()Ldev/inmo/tgbotapi/types/chat/PreviewUser; + public abstract fun getCompletionDate ()Ldev/inmo/tgbotapi/types/TelegramDate; +} + +public final class dev/inmo/tgbotapi/types/checklists/ChecklistTask$Created$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/checklists/ChecklistTask$Created$DefaultImpls { + public static fun getCompletedByUser (Ldev/inmo/tgbotapi/types/checklists/ChecklistTask$Created;)Ldev/inmo/tgbotapi/types/chat/PreviewUser; + public static fun getCompletionDate (Ldev/inmo/tgbotapi/types/checklists/ChecklistTask$Created;)Ldev/inmo/tgbotapi/types/TelegramDate; +} + +public final class dev/inmo/tgbotapi/types/checklists/ChecklistTask$Created$Serializer : kotlinx/serialization/KSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/checklists/ChecklistTask$Created$Serializer; + public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/checklists/ChecklistTask$Created; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/checklists/ChecklistTask$Created;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V +} + +public final class dev/inmo/tgbotapi/types/checklists/ChecklistTask$Done : dev/inmo/tgbotapi/types/checklists/ChecklistTask$Created { + public static final field Companion Ldev/inmo/tgbotapi/types/checklists/ChecklistTask$Done$Companion; + public synthetic fun (ILdev/inmo/tgbotapi/types/chat/PreviewUser;Ldev/inmo/tgbotapi/types/TelegramDate;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (ILdev/inmo/tgbotapi/types/chat/PreviewUser;Ldev/inmo/tgbotapi/types/TelegramDate;Ljava/util/List;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (ILjava/lang/String;Ldev/inmo/tgbotapi/types/chat/PreviewUser;Ldev/inmo/tgbotapi/types/TelegramDate;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1-9XrXEx4 ()I + public final fun component2 ()Ldev/inmo/tgbotapi/types/chat/PreviewUser; + public final fun component3 ()Ldev/inmo/tgbotapi/types/TelegramDate; + public final fun component4 ()Ljava/util/List; + public final fun copy-egrVBYk (ILdev/inmo/tgbotapi/types/chat/PreviewUser;Ldev/inmo/tgbotapi/types/TelegramDate;Ljava/util/List;)Ldev/inmo/tgbotapi/types/checklists/ChecklistTask$Done; + public static synthetic fun copy-egrVBYk$default (Ldev/inmo/tgbotapi/types/checklists/ChecklistTask$Done;ILdev/inmo/tgbotapi/types/chat/PreviewUser;Ldev/inmo/tgbotapi/types/TelegramDate;Ljava/util/List;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/checklists/ChecklistTask$Done; + public fun equals (Ljava/lang/Object;)Z + public fun getCompletedByUser ()Ldev/inmo/tgbotapi/types/chat/PreviewUser; + public fun getCompletionDate ()Ldev/inmo/tgbotapi/types/TelegramDate; + public fun getId-9XrXEx4 ()I + public fun getText ()Ljava/lang/String; + public fun getTextSources ()Ljava/util/List; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final class dev/inmo/tgbotapi/types/checklists/ChecklistTask$Done$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/checklists/ChecklistTask$Input : dev/inmo/tgbotapi/types/checklists/ChecklistTask { + public static final field Companion Ldev/inmo/tgbotapi/types/checklists/ChecklistTask$Input$Companion; + public synthetic fun (ILjava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (ILjava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (ILjava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/util/List;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (ILjava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (ILjava/util/List;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (ILkotlin/jvm/functions/Function1;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1-9XrXEx4 ()I + public final fun component2 ()Ljava/lang/String; + public final fun component3 ()Ldev/inmo/tgbotapi/types/message/ParseMode; + public final fun component4 ()Ljava/util/List; + public final fun copy-egrVBYk (ILjava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/util/List;)Ldev/inmo/tgbotapi/types/checklists/ChecklistTask$Input; + public static synthetic fun copy-egrVBYk$default (Ldev/inmo/tgbotapi/types/checklists/ChecklistTask$Input;ILjava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/util/List;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/checklists/ChecklistTask$Input; + public fun equals (Ljava/lang/Object;)Z + public fun getId-9XrXEx4 ()I + public final fun getParseMode ()Ldev/inmo/tgbotapi/types/message/ParseMode; + public fun getText ()Ljava/lang/String; + public fun getTextSources ()Ljava/util/List; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final class dev/inmo/tgbotapi/types/checklists/ChecklistTask$Input$Companion : kotlinx/serialization/KSerializer { + public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/checklists/ChecklistTask$Input; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/checklists/ChecklistTask$Input;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/checklists/ChecklistTask$Undone : dev/inmo/tgbotapi/types/checklists/ChecklistTask$Created { + public static final field Companion Ldev/inmo/tgbotapi/types/checklists/ChecklistTask$Undone$Companion; + public synthetic fun (ILjava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (ILjava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (ILjava/util/List;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1-9XrXEx4 ()I + public final fun component2 ()Ljava/util/List; + public final fun copy--FO1ySU (ILjava/util/List;)Ldev/inmo/tgbotapi/types/checklists/ChecklistTask$Undone; + public static synthetic fun copy--FO1ySU$default (Ldev/inmo/tgbotapi/types/checklists/ChecklistTask$Undone;ILjava/util/List;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/checklists/ChecklistTask$Undone; + public fun equals (Ljava/lang/Object;)Z + public fun getCompletedByUser ()Ldev/inmo/tgbotapi/types/chat/PreviewUser; + public fun getCompletionDate ()Ldev/inmo/tgbotapi/types/TelegramDate; + public fun getId-9XrXEx4 ()I + public fun getText ()Ljava/lang/String; + public fun getTextSources ()Ljava/util/List; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final class dev/inmo/tgbotapi/types/checklists/ChecklistTask$Undone$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/checklists/ChecklistTaskId { + public static final field Companion Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId$Companion; + public static final synthetic fun box-impl (I)Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId; + public static fun constructor-impl (I)I + public fun equals (Ljava/lang/Object;)Z + public static fun equals-impl (ILjava/lang/Object;)Z + public static final fun equals-impl0 (II)Z + public final fun getInt-pVg5ArA ()I + public fun hashCode ()I + public static fun hashCode-impl (I)I + public fun toString ()Ljava/lang/String; + public static fun toString-impl (I)Ljava/lang/String; + public final synthetic fun unbox-impl ()I +} + +public synthetic class dev/inmo/tgbotapi/types/checklists/ChecklistTaskId$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/checklists/ChecklistTaskId$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun deserialize-YVfj6vI (Lkotlinx/serialization/encoding/Decoder;)I + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serialize-sSeF6h8 (Lkotlinx/serialization/encoding/Encoder;I)V +} + +public final class dev/inmo/tgbotapi/types/checklists/ChecklistTaskId$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + public final class dev/inmo/tgbotapi/types/colors/ColorId { public static final field Companion Ldev/inmo/tgbotapi/types/colors/ColorId$Companion; public static final synthetic fun box-impl (I)Ldev/inmo/tgbotapi/types/colors/ColorId; @@ -22644,6 +22952,34 @@ public final class dev/inmo/tgbotapi/types/message/content/AudioMediaGroupPartCo public static fun createResend-f_HYr08 (Ldev/inmo/tgbotapi/types/message/content/AudioMediaGroupPartContent;Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/MessageId;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;)Ldev/inmo/tgbotapi/requests/abstracts/Request; } +public final class dev/inmo/tgbotapi/types/message/content/ChecklistContent : dev/inmo/tgbotapi/types/message/content/MessageContent { + public static final field Companion Ldev/inmo/tgbotapi/types/message/content/ChecklistContent$Companion; + public fun (Ldev/inmo/tgbotapi/types/checklists/Checklist$Created;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/checklists/Checklist$Created; + public final fun copy (Ldev/inmo/tgbotapi/types/checklists/Checklist$Created;)Ldev/inmo/tgbotapi/types/message/content/ChecklistContent; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/message/content/ChecklistContent;Ldev/inmo/tgbotapi/types/checklists/Checklist$Created;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/message/content/ChecklistContent; + public fun createResend-f_HYr08 (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/MessageId;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;)Ldev/inmo/tgbotapi/requests/abstracts/Request; + public fun createResend-rXDJoI8 (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;)Ldev/inmo/tgbotapi/requests/abstracts/Request; + public fun equals (Ljava/lang/Object;)Z + public final fun getChecklist ()Ldev/inmo/tgbotapi/types/checklists/Checklist$Created; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class dev/inmo/tgbotapi/types/message/content/ChecklistContent$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/message/content/ChecklistContent$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/message/content/ChecklistContent; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/message/content/ChecklistContent;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V +} + +public final class dev/inmo/tgbotapi/types/message/content/ChecklistContent$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + public final class dev/inmo/tgbotapi/types/message/content/ContactContent : dev/inmo/tgbotapi/types/message/content/MessageContent { public static final field Companion Ldev/inmo/tgbotapi/types/message/content/ContactContent$Companion; public fun (Ldev/inmo/tgbotapi/types/Contact;)V diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/ChecklistContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/ChecklistContent.kt index 45ae90a46a..40ba12f497 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/ChecklistContent.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/ChecklistContent.kt @@ -1,6 +1,7 @@ package dev.inmo.tgbotapi.types.message.content import dev.inmo.tgbotapi.requests.abstracts.Request +import dev.inmo.tgbotapi.requests.send.SendChecklist import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.EffectId import dev.inmo.tgbotapi.types.MessageThreadId @@ -8,13 +9,15 @@ import dev.inmo.tgbotapi.types.ReplyParameters import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.checklists.Checklist +import dev.inmo.tgbotapi.types.checklists.ChecklistTask import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage +import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import kotlinx.serialization.Serializable @Serializable data class ChecklistContent( - val checklist: Checklist + val checklist: Checklist.Created ) : MessageContent { override fun createResend( chatId: ChatIdentifier, @@ -26,7 +29,26 @@ data class ChecklistContent( effectId: EffectId?, replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? - ): Request> { - return SendChecklist + ): Request> { + return SendChecklist( + chatId = chatId, + checklist = Checklist.Input( + titleTextSources = checklist.titleTextSources, + tasks = checklist.tasks.map { + ChecklistTask.Input( + id = it.id, + textSources = it.textSources, + ) + }, + othersCanAddTasks = checklist.othersCanAddTasks, + othersCanCompleteTasks = checklist.othersCanCompleteTasks, + ), + businessConnectionId = businessConnectionId ?: error("Checklist can be sent only with business connection"), + disableNotification = disableNotification, + protectContent = protectContent, + effectId = effectId, + replyParameters = replyParameters, + replyMarkup = replyMarkup + ) } } diff --git a/tgbotapi.utils/api/tgbotapi.utils.api b/tgbotapi.utils/api/tgbotapi.utils.api index 6f40c07f8d..8f483ca7e7 100644 --- a/tgbotapi.utils/api/tgbotapi.utils.api +++ b/tgbotapi.utils/api/tgbotapi.utils.api @@ -1217,6 +1217,8 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun chatSharedRequestOrThrow (Ldev/inmo/tgbotapi/types/request/RequestResponse;)Ldev/inmo/tgbotapi/types/request/ChatSharedRequest; public static final fun chatThemeOrNull (Ldev/inmo/tgbotapi/types/BackgroundType;)Ldev/inmo/tgbotapi/types/BackgroundType$ChatTheme; public static final fun chatThemeOrThrow (Ldev/inmo/tgbotapi/types/BackgroundType;)Ldev/inmo/tgbotapi/types/BackgroundType$ChatTheme; + public static final fun checklistContentOrNull (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/ChecklistContent; + public static final fun checklistContentOrThrow (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/ChecklistContent; public static final fun chooseStickerActionOrNull (Ldev/inmo/tgbotapi/types/actions/BotAction;)Ldev/inmo/tgbotapi/types/actions/ChooseStickerAction; public static final fun chooseStickerActionOrThrow (Ldev/inmo/tgbotapi/types/actions/BotAction;)Ldev/inmo/tgbotapi/types/actions/ChooseStickerAction; public static final fun chosenInlineResultOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/InlineQueries/ChosenInlineResult/ChosenInlineResult; @@ -1591,6 +1593,7 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun ifChatSharedRequest (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifChatSharedRequest (Ldev/inmo/tgbotapi/types/request/RequestResponse;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifChatTheme (Ldev/inmo/tgbotapi/types/BackgroundType;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifChecklistContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifChooseStickerAction (Ldev/inmo/tgbotapi/types/actions/BotAction;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifChosenInlineResult (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifChosenInlineResultUpdate (Ldev/inmo/tgbotapi/types/update/abstracts/Update;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCastsNew.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCastsNew.kt index e613cccdb6..69632e929f 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCastsNew.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCastsNew.kt @@ -325,6 +325,7 @@ import dev.inmo.tgbotapi.types.message.abstracts.UnknownMessageType import dev.inmo.tgbotapi.types.message.content.AnimationContent import dev.inmo.tgbotapi.types.message.content.AudioContent import dev.inmo.tgbotapi.types.message.content.AudioMediaGroupPartContent +import dev.inmo.tgbotapi.types.message.content.ChecklistContent import dev.inmo.tgbotapi.types.message.content.ContactContent import dev.inmo.tgbotapi.types.message.content.DiceContent import dev.inmo.tgbotapi.types.message.content.DocumentContent @@ -4491,6 +4492,15 @@ public inline fun ResendableContent.audioContentOrThrow(): AudioContent = this a public inline fun ResendableContent.ifAudioContent(block: (AudioContent) -> T): T? = audioContentOrNull() ?.let(block) +public inline fun ResendableContent.checklistContentOrNull(): ChecklistContent? = this as? + dev.inmo.tgbotapi.types.message.content.ChecklistContent + +public inline fun ResendableContent.checklistContentOrThrow(): ChecklistContent = this as + dev.inmo.tgbotapi.types.message.content.ChecklistContent + +public inline fun ResendableContent.ifChecklistContent(block: (ChecklistContent) -> T): T? = + checklistContentOrNull() ?.let(block) + public inline fun ResendableContent.contactContentOrNull(): ContactContent? = this as? dev.inmo.tgbotapi.types.message.content.ContactContent From db8bac9b52502b2b3f93fd29da36726297f79bbb Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Mon, 7 Jul 2025 21:19:17 +0600 Subject: [PATCH 09/16] add ChecklistTasksAdded and ChecklistTasksDone events --- .../api/tgbotapi.behaviour_builder.api | 8 +++ .../expectations/WaitEventAction.kt | 12 ++++ .../triggers_handling/EventTriggers.kt | 46 ++++++++++++++ tgbotapi.core/api/tgbotapi.core.api | 62 +++++++++++++++++++ .../kotlin/dev/inmo/tgbotapi/types/Common.kt | 3 + .../types/checklists/ChecklistTasksAdded.kt | 20 ++++++ .../types/checklists/ChecklistTasksDone.kt | 21 +++++++ .../inmo/tgbotapi/types/message/RawMessage.kt | 8 ++- tgbotapi.utils/api/tgbotapi.utils.api | 6 ++ .../extensions/utils/ClassCastsNew.kt | 20 ++++++ 10 files changed, 204 insertions(+), 2 deletions(-) create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/ChecklistTasksAdded.kt create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/ChecklistTasksDone.kt diff --git a/tgbotapi.behaviour_builder/api/tgbotapi.behaviour_builder.api b/tgbotapi.behaviour_builder/api/tgbotapi.behaviour_builder.api index 4cdf816fd8..7b46834dff 100644 --- a/tgbotapi.behaviour_builder/api/tgbotapi.behaviour_builder.api +++ b/tgbotapi.behaviour_builder/api/tgbotapi.behaviour_builder.api @@ -624,6 +624,10 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W public static synthetic fun waitChatShared$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static final fun waitChatSharedRequest (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; public static synthetic fun waitChatSharedRequest$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; + public static final fun waitChecklistTasksAdded (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; + public static synthetic fun waitChecklistTasksAdded$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; + public static final fun waitChecklistTasksDone (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; + public static synthetic fun waitChecklistTasksDone$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static final fun waitCommonEvents (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; public static synthetic fun waitCommonEvents$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static final fun waitDeleteChatPhotoEvents (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; @@ -1330,6 +1334,10 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handl public static synthetic fun onChatShared$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static final fun onChatSharedRequest (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static synthetic fun onChatSharedRequest$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; + public static final fun onChecklistTasksAdded (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; + public static synthetic fun onChecklistTasksAdded$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; + public static final fun onChecklistTasksDone (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; + public static synthetic fun onChecklistTasksDone$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static final fun onCommonEvent (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static synthetic fun onCommonEvent$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static final fun onDeleteChatPhoto (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEventAction.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEventAction.kt index 205411ea97..46cbd08370 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEventAction.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEventAction.kt @@ -7,6 +7,8 @@ import dev.inmo.tgbotapi.extensions.utils.* import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.types.PaidMessagePriceChanged import dev.inmo.tgbotapi.types.chat.ChatBackground +import dev.inmo.tgbotapi.types.checklists.ChecklistTasksAdded +import dev.inmo.tgbotapi.types.checklists.ChecklistTasksDone import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceived import dev.inmo.tgbotapi.types.giveaway.GiveawayCreated import dev.inmo.tgbotapi.types.giveaway.GiveawayPrivateResults @@ -264,3 +266,13 @@ fun BehaviourContext.waitUniqueGiftSentOrReceived( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null } ) = waitEvents(initRequest, errorFactory) + +fun BehaviourContext.waitChecklistTasksDone( + initRequest: Request<*>? = null, + errorFactory: NullableRequestBuilder<*> = { null } +) = waitEvents(initRequest, errorFactory) + +fun BehaviourContext.waitChecklistTasksAdded( + initRequest: Request<*>? = null, + errorFactory: NullableRequestBuilder<*> = { null } +) = waitEvents(initRequest, errorFactory) diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EventTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EventTriggers.kt index 30ada1eeeb..bf92b42c45 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EventTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EventTriggers.kt @@ -12,6 +12,8 @@ import dev.inmo.tgbotapi.extensions.utils.baseSentMessageUpdateOrNull import dev.inmo.tgbotapi.extensions.utils.chatEventMessageOrNull import dev.inmo.tgbotapi.types.PaidMessagePriceChanged import dev.inmo.tgbotapi.types.chat.ChatBackground +import dev.inmo.tgbotapi.types.checklists.ChecklistTasksAdded +import dev.inmo.tgbotapi.types.checklists.ChecklistTasksDone import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceived import dev.inmo.tgbotapi.types.giveaway.GiveawayCreated import dev.inmo.tgbotapi.types.giveaway.GiveawayPrivateResults @@ -1112,3 +1114,47 @@ fun BC.onUniqueGiftSentOrReceived( additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver>? = null, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver) + + +/** + * @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call + * @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example, + * this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage]. + * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. + * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] + * to combinate several filters + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that + * data + */ +fun BC.onChecklistTasksDone( + initialFilter: SimpleFilter>? = null, + subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, + additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver>? = null, + scenarioReceiver: CustomBehaviourContextAndTypeReceiver> +) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver) + + +/** + * @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call + * @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example, + * this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage]. + * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. + * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] + * to combinate several filters + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that + * data + */ +fun BC.onChecklistTasksAdded( + initialFilter: SimpleFilter>? = null, + subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, + additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver>? = null, + scenarioReceiver: CustomBehaviourContextAndTypeReceiver> +) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver) diff --git a/tgbotapi.core/api/tgbotapi.core.api b/tgbotapi.core/api/tgbotapi.core.api index fbf3be29d4..63e4f42533 100644 --- a/tgbotapi.core/api/tgbotapi.core.api +++ b/tgbotapi.core/api/tgbotapi.core.api @@ -9755,6 +9755,7 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field chatTypeField Ljava/lang/String; public static final field chatsField Ljava/lang/String; public static final field checklistField Ljava/lang/String; + public static final field checklistMessageField Ljava/lang/String; public static final field cityField Ljava/lang/String; public static final field closeDateField Ljava/lang/String; public static final field closingMinuteField Ljava/lang/String; @@ -9935,6 +9936,8 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field loginUrlField Ljava/lang/String; public static final field longitudeField Ljava/lang/String; public static final field mainFrameTimestampField Ljava/lang/String; + public static final field markedAsDoneTaskIdsField Ljava/lang/String; + public static final field markedAsNotDoneTaskIdsField Ljava/lang/String; public static final field maskPositionField Ljava/lang/String; public static final field maxAllowedConnectionsField Ljava/lang/String; public static final field maxQuantityField Ljava/lang/String; @@ -17898,6 +17901,65 @@ public final class dev/inmo/tgbotapi/types/checklists/ChecklistTaskId$Companion public final fun serializer ()Lkotlinx/serialization/KSerializer; } +public final class dev/inmo/tgbotapi/types/checklists/ChecklistTasksAdded : dev/inmo/tgbotapi/types/message/ChatEvents/abstracts/CommonEvent { + public static final field Companion Ldev/inmo/tgbotapi/types/checklists/ChecklistTasksAdded$Companion; + public fun (Ldev/inmo/tgbotapi/types/message/abstracts/CommonMessage;Ljava/util/List;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/message/abstracts/CommonMessage; + public final fun component2 ()Ljava/util/List; + public final fun copy (Ldev/inmo/tgbotapi/types/message/abstracts/CommonMessage;Ljava/util/List;)Ldev/inmo/tgbotapi/types/checklists/ChecklistTasksAdded; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/checklists/ChecklistTasksAdded;Ldev/inmo/tgbotapi/types/message/abstracts/CommonMessage;Ljava/util/List;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/checklists/ChecklistTasksAdded; + public fun equals (Ljava/lang/Object;)Z + public final fun getChecklistMessage ()Ldev/inmo/tgbotapi/types/message/abstracts/CommonMessage; + public final fun getTasks ()Ljava/util/List; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class dev/inmo/tgbotapi/types/checklists/ChecklistTasksAdded$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/checklists/ChecklistTasksAdded$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/checklists/ChecklistTasksAdded; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/checklists/ChecklistTasksAdded;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V +} + +public final class dev/inmo/tgbotapi/types/checklists/ChecklistTasksAdded$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/checklists/ChecklistTasksDone : dev/inmo/tgbotapi/types/message/ChatEvents/abstracts/CommonEvent { + public static final field Companion Ldev/inmo/tgbotapi/types/checklists/ChecklistTasksDone$Companion; + public fun (Ldev/inmo/tgbotapi/types/message/abstracts/CommonMessage;Ljava/util/List;Ljava/util/List;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/message/abstracts/CommonMessage;Ljava/util/List;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/message/abstracts/CommonMessage; + public final fun component2 ()Ljava/util/List; + public final fun component3 ()Ljava/util/List; + public final fun copy (Ldev/inmo/tgbotapi/types/message/abstracts/CommonMessage;Ljava/util/List;Ljava/util/List;)Ldev/inmo/tgbotapi/types/checklists/ChecklistTasksDone; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/checklists/ChecklistTasksDone;Ldev/inmo/tgbotapi/types/message/abstracts/CommonMessage;Ljava/util/List;Ljava/util/List;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/checklists/ChecklistTasksDone; + public fun equals (Ljava/lang/Object;)Z + public final fun getChecklistMessage ()Ldev/inmo/tgbotapi/types/message/abstracts/CommonMessage; + public final fun getMarkedAsDone ()Ljava/util/List; + public final fun getMarkedAsNotDone ()Ljava/util/List; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class dev/inmo/tgbotapi/types/checklists/ChecklistTasksDone$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/checklists/ChecklistTasksDone$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/checklists/ChecklistTasksDone; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/checklists/ChecklistTasksDone;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V +} + +public final class dev/inmo/tgbotapi/types/checklists/ChecklistTasksDone$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + public final class dev/inmo/tgbotapi/types/colors/ColorId { public static final field Companion Ldev/inmo/tgbotapi/types/colors/ColorId$Companion; public static final synthetic fun box-impl (I)Ldev/inmo/tgbotapi/types/colors/ColorId; diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt index ff50ef8bfd..2bddebf041 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt @@ -315,6 +315,9 @@ const val tasksField = "tasks" const val othersCanAddTasksField = "others_can_add_tasks" const val othersCanMarkTasksAsDoneField = "others_can_mark_tasks_as_done" const val checklistField = "checklist" +const val checklistMessageField = "checklist_message" +const val markedAsDoneTaskIdsField = "marked_as_done_task_ids" +const val markedAsNotDoneTaskIdsField = "marked_as_not_done_task_ids" const val requestContactField = "request_contact" const val requestLocationField = "request_location" diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/ChecklistTasksAdded.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/ChecklistTasksAdded.kt new file mode 100644 index 0000000000..0fa05967ff --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/ChecklistTasksAdded.kt @@ -0,0 +1,20 @@ +package dev.inmo.tgbotapi.types.checklists + +import dev.inmo.tgbotapi.types.checklistMessageField +import dev.inmo.tgbotapi.types.markedAsDoneTaskIdsField +import dev.inmo.tgbotapi.types.markedAsNotDoneTaskIdsField +import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.CommonEvent +import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage +import dev.inmo.tgbotapi.types.message.content.ChecklistContent +import dev.inmo.tgbotapi.types.tasksField +import dev.inmo.tgbotapi.types.userField +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +@Serializable +data class ChecklistTasksAdded( + @SerialName(checklistMessageField) + val checklistMessage: CommonMessage, + @SerialName(tasksField) + val tasks: List, +) : CommonEvent diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/ChecklistTasksDone.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/ChecklistTasksDone.kt new file mode 100644 index 0000000000..a2fe468d8a --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/ChecklistTasksDone.kt @@ -0,0 +1,21 @@ +package dev.inmo.tgbotapi.types.checklists + +import dev.inmo.tgbotapi.types.checklistMessageField +import dev.inmo.tgbotapi.types.markedAsDoneTaskIdsField +import dev.inmo.tgbotapi.types.markedAsNotDoneTaskIdsField +import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.CommonEvent +import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage +import dev.inmo.tgbotapi.types.message.content.ChecklistContent +import dev.inmo.tgbotapi.types.userField +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +@Serializable +data class ChecklistTasksDone( + @SerialName(checklistMessageField) + val checklistMessage: CommonMessage, + @SerialName(markedAsDoneTaskIdsField) + val markedAsDone: List? = null, + @SerialName(markedAsNotDoneTaskIdsField) + val markedAsNotDone: List? = null, +) : CommonEvent 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 12e9200922..da0c4f94b1 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 @@ -6,6 +6,8 @@ import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup import dev.inmo.tgbotapi.types.chat.* import dev.inmo.tgbotapi.types.chat.CommonBot import dev.inmo.tgbotapi.types.chat.User +import dev.inmo.tgbotapi.types.checklists.ChecklistTasksAdded +import dev.inmo.tgbotapi.types.checklists.ChecklistTasksDone import dev.inmo.tgbotapi.types.dice.Dice import dev.inmo.tgbotapi.types.files.* import dev.inmo.tgbotapi.types.files.Sticker @@ -166,8 +168,8 @@ internal data class RawMessage( private val giveaway_completed: GiveawayPrivateResults? = null, // Checklists - private val checklist_tasks_done: Nothing, - private val checklist_tasks_added: Nothing, + private val checklist_tasks_done: ChecklistTasksDone? = null, + private val checklist_tasks_added: ChecklistTasksAdded? = null, // Gifts private val gift: GiftSentOrReceived.Regular? = null, @@ -297,6 +299,8 @@ internal data class RawMessage( paid_message_price_changed != null -> paid_message_price_changed gift != null -> gift unique_gift != null -> unique_gift + checklist_tasks_done != null -> checklist_tasks_done + checklist_tasks_added != null -> checklist_tasks_added else -> null } } diff --git a/tgbotapi.utils/api/tgbotapi.utils.api b/tgbotapi.utils/api/tgbotapi.utils.api index 8f483ca7e7..20ff36c1e3 100644 --- a/tgbotapi.utils/api/tgbotapi.utils.api +++ b/tgbotapi.utils/api/tgbotapi.utils.api @@ -1219,6 +1219,10 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun chatThemeOrThrow (Ldev/inmo/tgbotapi/types/BackgroundType;)Ldev/inmo/tgbotapi/types/BackgroundType$ChatTheme; public static final fun checklistContentOrNull (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/ChecklistContent; public static final fun checklistContentOrThrow (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/ChecklistContent; + public static final fun checklistTasksAddedOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/checklists/ChecklistTasksAdded; + public static final fun checklistTasksAddedOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/checklists/ChecklistTasksAdded; + public static final fun checklistTasksDoneOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/checklists/ChecklistTasksDone; + public static final fun checklistTasksDoneOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/checklists/ChecklistTasksDone; public static final fun chooseStickerActionOrNull (Ldev/inmo/tgbotapi/types/actions/BotAction;)Ldev/inmo/tgbotapi/types/actions/ChooseStickerAction; public static final fun chooseStickerActionOrThrow (Ldev/inmo/tgbotapi/types/actions/BotAction;)Ldev/inmo/tgbotapi/types/actions/ChooseStickerAction; public static final fun chosenInlineResultOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/InlineQueries/ChosenInlineResult/ChosenInlineResult; @@ -1594,6 +1598,8 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun ifChatSharedRequest (Ldev/inmo/tgbotapi/types/request/RequestResponse;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifChatTheme (Ldev/inmo/tgbotapi/types/BackgroundType;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifChecklistContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifChecklistTasksAdded (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifChecklistTasksDone (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifChooseStickerAction (Ldev/inmo/tgbotapi/types/actions/BotAction;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifChosenInlineResult (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifChosenInlineResultUpdate (Ldev/inmo/tgbotapi/types/update/abstracts/Update;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCastsNew.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCastsNew.kt index 69632e929f..37a2bf919d 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCastsNew.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCastsNew.kt @@ -173,6 +173,8 @@ import dev.inmo.tgbotapi.types.chat.member.RestrictedChatMember import dev.inmo.tgbotapi.types.chat.member.RestrictedMemberChatMember import dev.inmo.tgbotapi.types.chat.member.SpecialRightsChatMember import dev.inmo.tgbotapi.types.chat.member.SubscriptionMemberChatMember +import dev.inmo.tgbotapi.types.checklists.ChecklistTasksAdded +import dev.inmo.tgbotapi.types.checklists.ChecklistTasksDone import dev.inmo.tgbotapi.types.dice.BasketballDiceAnimationType import dev.inmo.tgbotapi.types.dice.BowlingDiceAnimationType import dev.inmo.tgbotapi.types.dice.CubeDiceAnimationType @@ -3349,6 +3351,24 @@ public inline fun ChatEvent.chatBackgroundOrThrow(): ChatBackground = this as public inline fun ChatEvent.ifChatBackground(block: (ChatBackground) -> T): T? = chatBackgroundOrNull() ?.let(block) +public inline fun ChatEvent.checklistTasksAddedOrNull(): ChecklistTasksAdded? = this as? + dev.inmo.tgbotapi.types.checklists.ChecklistTasksAdded + +public inline fun ChatEvent.checklistTasksAddedOrThrow(): ChecklistTasksAdded = this as + dev.inmo.tgbotapi.types.checklists.ChecklistTasksAdded + +public inline fun ChatEvent.ifChecklistTasksAdded(block: (ChecklistTasksAdded) -> T): T? = + checklistTasksAddedOrNull() ?.let(block) + +public inline fun ChatEvent.checklistTasksDoneOrNull(): ChecklistTasksDone? = this as? + dev.inmo.tgbotapi.types.checklists.ChecklistTasksDone + +public inline fun ChatEvent.checklistTasksDoneOrThrow(): ChecklistTasksDone = this as + dev.inmo.tgbotapi.types.checklists.ChecklistTasksDone + +public inline fun ChatEvent.ifChecklistTasksDone(block: (ChecklistTasksDone) -> T): T? = + checklistTasksDoneOrNull() ?.let(block) + public inline fun ChatEvent.giftSentOrReceivedOrNull(): GiftSentOrReceived? = this as? dev.inmo.tgbotapi.types.gifts.GiftSentOrReceived From b8530f14ca9eae8a88e240ca4f1fc3a0432f5658 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Mon, 7 Jul 2025 21:29:29 +0600 Subject: [PATCH 10/16] add checklist as field in ExternalReplyInfo and add support of EditMessageChecklist --- tgbotapi.api/api/tgbotapi.api.api | 7 +++ .../edit/checklist/EditMessageChecklist.kt | 47 +++++++++++++++++++ tgbotapi.core/api/tgbotapi.core.api | 46 +++++++++++++++++- .../edit/checklist/EditMessageChecklist.kt | 37 +++++++++++++++ .../dev/inmo/tgbotapi/types/ReplyInfo.kt | 3 ++ .../tgbotapi/types/checklists/Checklist.kt | 3 +- 6 files changed, 141 insertions(+), 2 deletions(-) create mode 100644 tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/checklist/EditMessageChecklist.kt create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/edit/checklist/EditMessageChecklist.kt diff --git a/tgbotapi.api/api/tgbotapi.api.api b/tgbotapi.api/api/tgbotapi.api.api index 469b04af7a..cb8770987d 100644 --- a/tgbotapi.api/api/tgbotapi.api.api +++ b/tgbotapi.api/api/tgbotapi.api.api @@ -928,6 +928,13 @@ public final class dev/inmo/tgbotapi/extensions/api/edit/caption/EditInlineMessa public static synthetic fun editMessageCaption-KUlcsOA$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; } +public final class dev/inmo/tgbotapi/extensions/api/edit/checklist/EditMessageChecklistKt { + public static final fun editMessageChecklist (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/BusinessContentMessage;Ldev/inmo/tgbotapi/types/checklists/Checklist$Input;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun editMessageChecklist$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/BusinessContentMessage;Ldev/inmo/tgbotapi/types/checklists/Checklist$Input;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final fun editMessageChecklist-rhNz7xc (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;JLjava/lang/String;Ldev/inmo/tgbotapi/types/checklists/Checklist$Input;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun editMessageChecklist-rhNz7xc$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;JLjava/lang/String;Ldev/inmo/tgbotapi/types/checklists/Checklist$Input;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; +} + public final class dev/inmo/tgbotapi/extensions/api/edit/location/live/EditChatMessageLiveLocationKt { public static final fun editLiveLocation-K1rWLlE (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;JDDLjava/lang/Integer;Ljava/lang/Float;Ljava/lang/Integer;Ljava/lang/Float;Ljava/lang/String;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun editLiveLocation-K1rWLlE (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/Chat;JDDLjava/lang/Integer;Ljava/lang/Float;Ljava/lang/Integer;Ljava/lang/Float;Ljava/lang/String;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/checklist/EditMessageChecklist.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/checklist/EditMessageChecklist.kt new file mode 100644 index 0000000000..7664399ffd --- /dev/null +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/checklist/EditMessageChecklist.kt @@ -0,0 +1,47 @@ +package dev.inmo.tgbotapi.extensions.api.edit.checklist + +import dev.inmo.tgbotapi.bot.TelegramBot +import dev.inmo.tgbotapi.requests.edit.checklist.EditMessageChecklist +import dev.inmo.tgbotapi.types.ChatIdentifier +import dev.inmo.tgbotapi.types.MessageId +import dev.inmo.tgbotapi.types.businessConnectionIdField +import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId +import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup +import dev.inmo.tgbotapi.types.checklistField +import dev.inmo.tgbotapi.types.checklists.Checklist +import dev.inmo.tgbotapi.types.message.abstracts.BusinessContentMessage +import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage +import dev.inmo.tgbotapi.types.message.content.ChecklistContent +import dev.inmo.tgbotapi.types.messageIdField +import dev.inmo.tgbotapi.types.replyMarkupField +import kotlinx.serialization.SerialName + +public suspend fun TelegramBot.editMessageChecklist( + chatId: ChatIdentifier, + messageId: MessageId, + businessConnectionId: BusinessConnectionId, + checklist: Checklist.Input, + replyMarkup: InlineKeyboardMarkup? = null +): ContentMessage = execute( + EditMessageChecklist( + chatId = chatId, + messageId = messageId, + businessConnectionId = businessConnectionId, + checklist = checklist, + replyMarkup = replyMarkup + ) +) + +public suspend fun TelegramBot.editMessageChecklist( + message: BusinessContentMessage, + checklist: Checklist.Input, + replyMarkup: InlineKeyboardMarkup? = null +): ContentMessage = execute( + EditMessageChecklist( + chatId = message.chat.id, + messageId = message.messageId, + businessConnectionId = message.businessConnectionId, + checklist = checklist, + replyMarkup = replyMarkup + ) +) diff --git a/tgbotapi.core/api/tgbotapi.core.api b/tgbotapi.core/api/tgbotapi.core.api index 63e4f42533..d83b4e7d8f 100644 --- a/tgbotapi.core/api/tgbotapi.core.api +++ b/tgbotapi.core/api/tgbotapi.core.api @@ -4322,6 +4322,50 @@ public final class dev/inmo/tgbotapi/requests/edit/caption/EditInlineMessageCapt public static synthetic fun EditInlineMessageCaption-3bQJ72M$default (Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;ILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/edit/caption/EditInlineMessageCaption; } +public final class dev/inmo/tgbotapi/requests/edit/checklist/EditMessageChecklist : dev/inmo/tgbotapi/requests/edit/abstracts/EditChatMessage, dev/inmo/tgbotapi/requests/edit/abstracts/EditReplyMessage { + public static final field Companion Ldev/inmo/tgbotapi/requests/edit/checklist/EditMessageChecklist$Companion; + public synthetic fun (Ldev/inmo/tgbotapi/types/ChatIdentifier;JLjava/lang/String;Ldev/inmo/tgbotapi/types/checklists/Checklist$Input;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/ChatIdentifier;JLjava/lang/String;Ldev/inmo/tgbotapi/types/checklists/Checklist$Input;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/ChatIdentifier; + public final fun component2-APLFQys ()J + public final fun component3-T-_HSQI ()Ljava/lang/String; + public final fun component4 ()Ldev/inmo/tgbotapi/types/checklists/Checklist$Input; + public final fun component5 ()Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup; + public final fun copy--CEwGbA (Ldev/inmo/tgbotapi/types/ChatIdentifier;JLjava/lang/String;Ldev/inmo/tgbotapi/types/checklists/Checklist$Input;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;)Ldev/inmo/tgbotapi/requests/edit/checklist/EditMessageChecklist; + public static synthetic fun copy--CEwGbA$default (Ldev/inmo/tgbotapi/requests/edit/checklist/EditMessageChecklist;Ldev/inmo/tgbotapi/types/ChatIdentifier;JLjava/lang/String;Ldev/inmo/tgbotapi/types/checklists/Checklist$Input;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;ILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/edit/checklist/EditMessageChecklist; + public fun equals (Ljava/lang/Object;)Z + public fun getBusinessConnectionId-T-_HSQI ()Ljava/lang/String; + public synthetic fun getBusinessConnectionId-nXr5wdE ()Ljava/lang/String; + public fun getChatId ()Ldev/inmo/tgbotapi/types/ChatIdentifier; + public final fun getChecklist ()Ldev/inmo/tgbotapi/types/checklists/Checklist$Input; + public fun getMessageId-APLFQys ()J + public fun getReplyMarkup ()Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup; + public synthetic fun getReplyMarkup ()Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup; + public fun getRequestSerializer ()Lkotlinx/serialization/SerializationStrategy; + public fun getResultDeserializer ()Lkotlinx/serialization/DeserializationStrategy; + public fun hashCode ()I + public fun method ()Ljava/lang/String; + public fun toString ()Ljava/lang/String; +} + +public synthetic class dev/inmo/tgbotapi/requests/edit/checklist/EditMessageChecklist$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/requests/edit/checklist/EditMessageChecklist$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/requests/edit/checklist/EditMessageChecklist; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/requests/edit/checklist/EditMessageChecklist;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V +} + +public final class dev/inmo/tgbotapi/requests/edit/checklist/EditMessageChecklist$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/requests/edit/checklist/EditMessageChecklistKt { + public static final field editMessageChecklistMethod Ljava/lang/String; +} + public final class dev/inmo/tgbotapi/requests/edit/location/live/EditChatMessageLiveLocation : dev/inmo/tgbotapi/requests/edit/abstracts/EditChatMessage, dev/inmo/tgbotapi/requests/edit/abstracts/EditLocationMessage, dev/inmo/tgbotapi/requests/edit/abstracts/EditReplyMessage { public static final field Companion Ldev/inmo/tgbotapi/requests/edit/location/live/EditChatMessageLiveLocation$Companion; public synthetic fun (Ldev/inmo/tgbotapi/types/ChatIdentifier;JDDLjava/lang/Integer;Ljava/lang/Float;Ljava/lang/Integer;Ljava/lang/Float;Ljava/lang/String;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;ILkotlin/jvm/internal/DefaultConstructorMarker;)V @@ -17672,7 +17716,7 @@ public final class dev/inmo/tgbotapi/types/checklists/Checklist$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public final class dev/inmo/tgbotapi/types/checklists/Checklist$Created : dev/inmo/tgbotapi/types/checklists/Checklist { +public final class dev/inmo/tgbotapi/types/checklists/Checklist$Created : dev/inmo/tgbotapi/types/ReplyInfo$External$ContentVariant, dev/inmo/tgbotapi/types/checklists/Checklist { public static final field Companion Ldev/inmo/tgbotapi/types/checklists/Checklist$Created$Companion; public fun (Ljava/util/List;Ljava/util/List;ZZ)V public synthetic fun (Ljava/util/List;Ljava/util/List;ZZILkotlin/jvm/internal/DefaultConstructorMarker;)V diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/edit/checklist/EditMessageChecklist.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/edit/checklist/EditMessageChecklist.kt new file mode 100644 index 0000000000..1f060c528d --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/edit/checklist/EditMessageChecklist.kt @@ -0,0 +1,37 @@ +package dev.inmo.tgbotapi.requests.edit.checklist + +import dev.inmo.tgbotapi.requests.edit.abstracts.EditChatMessage +import dev.inmo.tgbotapi.requests.edit.abstracts.EditReplyMessage +import dev.inmo.tgbotapi.types.* +import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId +import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup +import dev.inmo.tgbotapi.types.checklists.Checklist +import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage +import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass +import dev.inmo.tgbotapi.types.message.content.ChecklistContent +import dev.inmo.tgbotapi.types.message.content.MessageContent +import kotlinx.serialization.* + +const val editMessageChecklistMethod = "editMessageChecklist" + +private val commonResultDeserializer = TelegramBotAPIMessageDeserializationStrategyClass>() + +@Serializable +data class EditMessageChecklist( + @SerialName(chatIdField) + override val chatId: ChatIdentifier, + @SerialName(messageIdField) + override val messageId: MessageId, + @SerialName(businessConnectionIdField) + override val businessConnectionId: BusinessConnectionId, + @SerialName(checklistField) + val checklist: Checklist.Input, + @SerialName(replyMarkupField) + override val replyMarkup: InlineKeyboardMarkup? = null +) : EditChatMessage, EditReplyMessage { + override fun method(): String = editMessageChecklistMethod + override val resultDeserializer: DeserializationStrategy> + get() = commonResultDeserializer + override val requestSerializer: SerializationStrategy<*> + get() = serializer() +} diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ReplyInfo.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ReplyInfo.kt index 6d796eb1cb..222041fdbd 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ReplyInfo.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ReplyInfo.kt @@ -2,6 +2,7 @@ package dev.inmo.tgbotapi.types import dev.inmo.tgbotapi.abstracts.SpoilerableData import dev.inmo.tgbotapi.types.chat.SuperPublicChat +import dev.inmo.tgbotapi.types.checklists.Checklist import dev.inmo.tgbotapi.types.dice.Dice import dev.inmo.tgbotapi.types.files.* import dev.inmo.tgbotapi.types.games.RawGame @@ -105,6 +106,7 @@ sealed interface ReplyInfo { private val invoice: Invoice? = null, private val dice: Dice? = null, private val giveaway: Giveaway? = null, + private val checklist: Checklist.Created? = null, private val giveaway_winners: GiveawayPublicResults? = null, ) { val asExternalReplyInfo: External @@ -137,6 +139,7 @@ sealed interface ReplyInfo { invoice != null -> invoice giveaway != null -> giveaway giveaway_winners != null -> giveaway_winners + checklist != null -> checklist else -> null } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/Checklist.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/Checklist.kt index 29cf823fcd..e85509049b 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/Checklist.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/Checklist.kt @@ -2,6 +2,7 @@ package dev.inmo.tgbotapi.types.checklists import dev.inmo.micro_utils.common.Warning import dev.inmo.tgbotapi.abstracts.TitledInput +import dev.inmo.tgbotapi.types.ReplyInfo import dev.inmo.tgbotapi.types.checklists.ChecklistTask.Input import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.RawMessageEntity @@ -135,7 +136,7 @@ sealed interface Checklist : TitledInput { override val othersCanAddTasks: Boolean = false, @SerialName(othersCanMarkTasksAsDoneField) override val othersCanCompleteTasks: Boolean = false, - ): Checklist { + ): Checklist, ReplyInfo.External.ContentVariant { override val title: String by lazy { titleTextSources.makeSourceString() } From c990d987f5694808505a2770eb728e844a21849b Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Mon, 7 Jul 2025 21:48:23 +0600 Subject: [PATCH 11/16] add support of general changes --- tgbotapi.api/api/tgbotapi.api.api | 4 ++ .../extensions/api/bot/GetMyStarBalance.kt | 9 +++ .../api/tgbotapi.behaviour_builder.api | 4 ++ .../expectations/WaitEventAction.kt | 6 ++ .../triggers_handling/EventTriggers.kt | 24 +++++++ tgbotapi.core/api/tgbotapi.core.api | 64 +++++++++++++++++ .../tgbotapi/requests/bot/GetMyStarBalance.kt | 15 ++++ .../kotlin/dev/inmo/tgbotapi/types/Common.kt | 2 +- .../types/DirectMessagePriceChanged.kt | 71 +++++++++++++++++++ .../inmo/tgbotapi/types/message/RawMessage.kt | 4 ++ tgbotapi.utils/api/tgbotapi.utils.api | 12 ++++ .../extensions/utils/ClassCastsNew.kt | 49 +++++++++++++ .../dev/inmo/tgbotapi/webapps/WebApp.kt | 2 + 13 files changed, 265 insertions(+), 1 deletion(-) create mode 100644 tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/GetMyStarBalance.kt create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/bot/GetMyStarBalance.kt create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/DirectMessagePriceChanged.kt diff --git a/tgbotapi.api/api/tgbotapi.api.api b/tgbotapi.api/api/tgbotapi.api.api index cb8770987d..312e3f583a 100644 --- a/tgbotapi.api/api/tgbotapi.api.api +++ b/tgbotapi.api/api/tgbotapi.api.api @@ -294,6 +294,10 @@ public final class dev/inmo/tgbotapi/extensions/api/bot/GetMyShortDescriptionKt public static synthetic fun getMyShortDescription$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/micro_utils/language_codes/IetfLang;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; } +public final class dev/inmo/tgbotapi/extensions/api/bot/GetMyStarBalanceKt { + public static final fun getMyStarBalance (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; +} + public final class dev/inmo/tgbotapi/extensions/api/bot/SetMyCommandsKt { public static final fun setMyCommands (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ljava/util/List;Ldev/inmo/tgbotapi/types/commands/BotCommandScope;Ldev/inmo/micro_utils/language_codes/IetfLang;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun setMyCommands (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ljava/util/List;Ldev/inmo/tgbotapi/types/commands/BotCommandScope;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/GetMyStarBalance.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/GetMyStarBalance.kt new file mode 100644 index 0000000000..d4ebb210ba --- /dev/null +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/GetMyStarBalance.kt @@ -0,0 +1,9 @@ +package dev.inmo.tgbotapi.extensions.api.bot + +import dev.inmo.tgbotapi.bot.TelegramBot +import dev.inmo.tgbotapi.requests.bot.GetMe +import dev.inmo.tgbotapi.requests.bot.GetMyStarBalance +import dev.inmo.tgbotapi.types.chat.ExtendedBot +import dev.inmo.tgbotapi.types.payments.stars.StarAmount + +public suspend fun TelegramBot.getMyStarBalance(): StarAmount = execute(GetMyStarBalance) diff --git a/tgbotapi.behaviour_builder/api/tgbotapi.behaviour_builder.api b/tgbotapi.behaviour_builder/api/tgbotapi.behaviour_builder.api index 7b46834dff..69e311efa2 100644 --- a/tgbotapi.behaviour_builder/api/tgbotapi.behaviour_builder.api +++ b/tgbotapi.behaviour_builder/api/tgbotapi.behaviour_builder.api @@ -612,6 +612,8 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEventActionKt { public static final fun waitChannelChatCreatedEvents (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; public static synthetic fun waitChannelChatCreatedEvents$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; + public static final fun waitChannelDirectMessagesConfigurationChanged (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; + public static synthetic fun waitChannelDirectMessagesConfigurationChanged$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static final fun waitChannelEvents (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; public static synthetic fun waitChannelEvents$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static final fun waitChatBackgroundSet (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; @@ -1322,6 +1324,8 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handl public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EventTriggersKt { public static final fun onChannelChatCreated (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static synthetic fun onChannelChatCreated$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; + public static final fun onChannelDirectMessagesConfigurationChanged (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; + public static synthetic fun onChannelDirectMessagesConfigurationChanged$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static final fun onChannelEvent (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static synthetic fun onChannelEvent$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static final fun onChatBackgroundSet (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEventAction.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEventAction.kt index 46cbd08370..5a92978f4d 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEventAction.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEventAction.kt @@ -5,6 +5,7 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext import dev.inmo.tgbotapi.extensions.utils.* import dev.inmo.tgbotapi.requests.abstracts.Request +import dev.inmo.tgbotapi.types.ChannelDirectMessagesConfigurationChanged import dev.inmo.tgbotapi.types.PaidMessagePriceChanged import dev.inmo.tgbotapi.types.chat.ChatBackground import dev.inmo.tgbotapi.types.checklists.ChecklistTasksAdded @@ -276,3 +277,8 @@ fun BehaviourContext.waitChecklistTasksAdded( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null } ) = waitEvents(initRequest, errorFactory) + +fun BehaviourContext.waitChannelDirectMessagesConfigurationChanged( + initRequest: Request<*>? = null, + errorFactory: NullableRequestBuilder<*> = { null } +) = waitEvents(initRequest, errorFactory) diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EventTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EventTriggers.kt index bf92b42c45..543de9833d 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EventTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EventTriggers.kt @@ -10,6 +10,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.Mar import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times import dev.inmo.tgbotapi.extensions.utils.baseSentMessageUpdateOrNull import dev.inmo.tgbotapi.extensions.utils.chatEventMessageOrNull +import dev.inmo.tgbotapi.types.ChannelDirectMessagesConfigurationChanged import dev.inmo.tgbotapi.types.PaidMessagePriceChanged import dev.inmo.tgbotapi.types.chat.ChatBackground import dev.inmo.tgbotapi.types.checklists.ChecklistTasksAdded @@ -17,6 +18,7 @@ import dev.inmo.tgbotapi.types.checklists.ChecklistTasksDone import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceived import dev.inmo.tgbotapi.types.giveaway.GiveawayCreated import dev.inmo.tgbotapi.types.giveaway.GiveawayPrivateResults +import dev.inmo.tgbotapi.types.message.ChannelEventMessage import dev.inmo.tgbotapi.types.message.ChatEvents.* import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.* import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicClosed @@ -1158,3 +1160,25 @@ fun BC.onChecklistTasksAdded( additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver>? = null, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver) + + +/** + * @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call + * @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example, + * this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage]. + * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. + * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] + * to combinate several filters + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that + * data + */ +fun BC.onChannelDirectMessagesConfigurationChanged( + initialFilter: SimpleFilter>? = null, + subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, + additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver>? = null, + scenarioReceiver: CustomBehaviourContextAndTypeReceiver> +) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver) diff --git a/tgbotapi.core/api/tgbotapi.core.api b/tgbotapi.core/api/tgbotapi.core.api index d83b4e7d8f..9c1aae9a31 100644 --- a/tgbotapi.core/api/tgbotapi.core.api +++ b/tgbotapi.core/api/tgbotapi.core.api @@ -1737,6 +1737,14 @@ public final class dev/inmo/tgbotapi/requests/bot/GetMyShortDescription$Companio public final fun serializer ()Lkotlinx/serialization/KSerializer; } +public final class dev/inmo/tgbotapi/requests/bot/GetMyStarBalance : dev/inmo/tgbotapi/requests/abstracts/SimpleRequest { + public static final field INSTANCE Ldev/inmo/tgbotapi/requests/bot/GetMyStarBalance; + public fun getRequestSerializer ()Lkotlinx/serialization/SerializationStrategy; + public fun getResultDeserializer ()Lkotlinx/serialization/DeserializationStrategy; + public fun method ()Ljava/lang/String; + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + public abstract interface class dev/inmo/tgbotapi/requests/bot/MyCommandsRequest : dev/inmo/tgbotapi/requests/abstracts/SimpleRequest, dev/inmo/tgbotapi/types/abstracts/WithOptionalLanguageCode { public abstract fun getScope ()Ldev/inmo/tgbotapi/types/commands/BotCommandScope; } @@ -9378,6 +9386,62 @@ public final class dev/inmo/tgbotapi/types/CallbackQueryId$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } +public abstract interface class dev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged : dev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChannelEvent { + public static final field Companion Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Companion; + public abstract fun getCost ()Ljava/lang/Integer; + public abstract fun getEnabled ()Z +} + +public final class dev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Companion : kotlinx/serialization/KSerializer { + public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Disabled : dev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Disabled; + public fun getCost ()Ljava/lang/Integer; + public fun getEnabled ()Z + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Free : dev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Free; + public fun getCost ()Ljava/lang/Integer; + public fun getEnabled ()Z + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Paid : dev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged { + public static final field Companion Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Paid$Companion; + public fun (I)V + public final fun component1 ()I + public final fun copy (I)Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Paid; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Paid;IILjava/lang/Object;)Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Paid; + public fun equals (Ljava/lang/Object;)Z + public fun getCost ()Ljava/lang/Integer; + public fun getEnabled ()Z + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class dev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Paid$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Paid$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Paid; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Paid;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V +} + +public final class dev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Paid$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + public final class dev/inmo/tgbotapi/types/ChatId : dev/inmo/tgbotapi/types/IdChatIdentifier { public static final field Companion Ldev/inmo/tgbotapi/types/ChatId$Companion; public static final synthetic fun box-impl (J)Ldev/inmo/tgbotapi/types/ChatId; diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/bot/GetMyStarBalance.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/bot/GetMyStarBalance.kt new file mode 100644 index 0000000000..b731cb4494 --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/bot/GetMyStarBalance.kt @@ -0,0 +1,15 @@ +package dev.inmo.tgbotapi.requests.bot + +import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest +import dev.inmo.tgbotapi.types.chat.ExtendedBot +import dev.inmo.tgbotapi.types.payments.stars.StarAmount +import kotlinx.serialization.* + +@Serializable +object GetMyStarBalance : SimpleRequest { + override fun method(): String = "getMyStarBalance" + override val resultDeserializer: DeserializationStrategy + get() = StarAmount.serializer() + override val requestSerializer: SerializationStrategy<*> + get() = serializer() +} diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt index 2bddebf041..68b97f7d7e 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt @@ -71,7 +71,7 @@ val invoicePayloadBytesLimit = 1 until 128 val pollOptionTextLength = 1 .. 100 val pollQuestionTextLength = 1 .. 300 -val pollOptionsLimit = 2 .. 10 +val pollOptionsLimit = 2 .. 12 val livePeriodLimit = 60 .. LiveLocation.INDEFINITE_LIVE_PERIOD diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/DirectMessagePriceChanged.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/DirectMessagePriceChanged.kt new file mode 100644 index 0000000000..403f9a72c4 --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/DirectMessagePriceChanged.kt @@ -0,0 +1,71 @@ +package dev.inmo.tgbotapi.types + +import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelEvent +import kotlinx.serialization.KSerializer +import kotlinx.serialization.Serializable +import kotlinx.serialization.descriptors.SerialDescriptor +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder + +@Serializable +sealed interface ChannelDirectMessagesConfigurationChanged : ChannelEvent { + val enabled: Boolean + val cost: Int? + @Serializable + object Disabled : ChannelDirectMessagesConfigurationChanged { + override val enabled: Boolean + get() = false + override val cost: Int? + get() = null + } + @Serializable + object Free : ChannelDirectMessagesConfigurationChanged { + override val enabled: Boolean + get() = true + override val cost: Int + get() = 0 + } + @Serializable + data class Paid( + override val cost: Int + ) : ChannelDirectMessagesConfigurationChanged { + override val enabled: Boolean + get() = true + } + + companion object : KSerializer { + @Serializable + private data class RawDirectMessagePriceChanged( + val are_direct_messages_enabled: Boolean = false, + val direct_message_star_count: Int? = null + ) + override val descriptor: SerialDescriptor + get() = RawDirectMessagePriceChanged.serializer().descriptor + + override fun serialize( + encoder: Encoder, + value: ChannelDirectMessagesConfigurationChanged + ) { + RawDirectMessagePriceChanged.serializer().serialize( + encoder, + RawDirectMessagePriceChanged( + value.enabled, + value.cost + ) + ) + } + + override fun deserialize(decoder: Decoder): ChannelDirectMessagesConfigurationChanged { + val raw = RawDirectMessagePriceChanged.serializer().deserialize(decoder) + + return when { + raw.are_direct_messages_enabled == false -> Disabled + raw.direct_message_star_count == null || raw.direct_message_star_count == 0 -> Free + else -> Paid( + raw.direct_message_star_count + ) + } + } + + } +} 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 da0c4f94b1..4f5b5134d2 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 @@ -171,6 +171,9 @@ internal data class RawMessage( private val checklist_tasks_done: ChecklistTasksDone? = null, private val checklist_tasks_added: ChecklistTasksAdded? = null, + // Channel direct messages + private val direct_message_price_changed: ChannelDirectMessagesConfigurationChanged? = null, + // Gifts private val gift: GiftSentOrReceived.Regular? = null, private val unique_gift: GiftSentOrReceived.Unique? = null, @@ -301,6 +304,7 @@ internal data class RawMessage( unique_gift != null -> unique_gift checklist_tasks_done != null -> checklist_tasks_done checklist_tasks_added != null -> checklist_tasks_added + direct_message_price_changed != null -> direct_message_price_changed else -> null } } diff --git a/tgbotapi.utils/api/tgbotapi.utils.api b/tgbotapi.utils/api/tgbotapi.utils.api index 20ff36c1e3..bdd0a9c2e3 100644 --- a/tgbotapi.utils/api/tgbotapi.utils.api +++ b/tgbotapi.utils/api/tgbotapi.utils.api @@ -1163,6 +1163,14 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun channelContentMessageOrNull (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/ChannelContentMessage; public static final fun channelContentMessageOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/ChannelContentMessage; public static final fun channelContentMessageOrThrow (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/ChannelContentMessage; + public static final fun channelDirectMessagesConfigurationChangedDisabledOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Disabled; + public static final fun channelDirectMessagesConfigurationChangedDisabledOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Disabled; + public static final fun channelDirectMessagesConfigurationChangedFreeOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Free; + public static final fun channelDirectMessagesConfigurationChangedFreeOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Free; + public static final fun channelDirectMessagesConfigurationChangedOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged; + public static final fun channelDirectMessagesConfigurationChangedOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged; + public static final fun channelDirectMessagesConfigurationChangedPaidOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Paid; + public static final fun channelDirectMessagesConfigurationChangedPaidOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Paid; public static final fun channelEventMessageOrNull (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/ChannelEventMessage; public static final fun channelEventMessageOrThrow (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/ChannelEventMessage; public static final fun channelEventOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChannelEvent; @@ -1570,6 +1578,10 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun ifChannelChatCreated (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifChannelContentMessage (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifChannelContentMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifChannelDirectMessagesConfigurationChanged (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifChannelDirectMessagesConfigurationChangedDisabled (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifChannelDirectMessagesConfigurationChangedFree (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifChannelDirectMessagesConfigurationChangedPaid (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifChannelEvent (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifChannelEventMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifChannelPostUpdate (Ldev/inmo/tgbotapi/types/update/abstracts/Update;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCastsNew.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCastsNew.kt index 37a2bf919d..15814b239e 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCastsNew.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCastsNew.kt @@ -21,6 +21,7 @@ import dev.inmo.tgbotapi.requests.stickers.InputSticker import dev.inmo.tgbotapi.types.BackgroundFill import dev.inmo.tgbotapi.types.BackgroundType import dev.inmo.tgbotapi.types.BusinessChatId +import dev.inmo.tgbotapi.types.ChannelDirectMessagesConfigurationChanged import dev.inmo.tgbotapi.types.ChatId import dev.inmo.tgbotapi.types.ChatIdWithThreadId import dev.inmo.tgbotapi.types.ChatIdentifier @@ -3333,6 +3334,54 @@ public inline fun TelegramMedia.ifWithCustomizableCaptionTelegramMedia(block: (WithCustomizableCaptionTelegramMedia) -> T): T? = withCustomizableCaptionTelegramMediaOrNull() ?.let(block) +public inline fun ChatEvent.channelDirectMessagesConfigurationChangedOrNull(): + ChannelDirectMessagesConfigurationChanged? = this as? + dev.inmo.tgbotapi.types.ChannelDirectMessagesConfigurationChanged + +public inline fun ChatEvent.channelDirectMessagesConfigurationChangedOrThrow(): + ChannelDirectMessagesConfigurationChanged = this as + dev.inmo.tgbotapi.types.ChannelDirectMessagesConfigurationChanged + +public inline fun + ChatEvent.ifChannelDirectMessagesConfigurationChanged(block: (ChannelDirectMessagesConfigurationChanged) -> T): + T? = channelDirectMessagesConfigurationChangedOrNull() ?.let(block) + +public inline fun ChatEvent.channelDirectMessagesConfigurationChangedDisabledOrNull(): + ChannelDirectMessagesConfigurationChanged.Disabled? = this as? + dev.inmo.tgbotapi.types.ChannelDirectMessagesConfigurationChanged.Disabled + +public inline fun ChatEvent.channelDirectMessagesConfigurationChangedDisabledOrThrow(): + ChannelDirectMessagesConfigurationChanged.Disabled = this as + dev.inmo.tgbotapi.types.ChannelDirectMessagesConfigurationChanged.Disabled + +public inline fun + ChatEvent.ifChannelDirectMessagesConfigurationChangedDisabled(block: (ChannelDirectMessagesConfigurationChanged.Disabled) -> T): + T? = channelDirectMessagesConfigurationChangedDisabledOrNull() ?.let(block) + +public inline fun ChatEvent.channelDirectMessagesConfigurationChangedFreeOrNull(): + ChannelDirectMessagesConfigurationChanged.Free? = this as? + dev.inmo.tgbotapi.types.ChannelDirectMessagesConfigurationChanged.Free + +public inline fun ChatEvent.channelDirectMessagesConfigurationChangedFreeOrThrow(): + ChannelDirectMessagesConfigurationChanged.Free = this as + dev.inmo.tgbotapi.types.ChannelDirectMessagesConfigurationChanged.Free + +public inline fun + ChatEvent.ifChannelDirectMessagesConfigurationChangedFree(block: (ChannelDirectMessagesConfigurationChanged.Free) -> T): + T? = channelDirectMessagesConfigurationChangedFreeOrNull() ?.let(block) + +public inline fun ChatEvent.channelDirectMessagesConfigurationChangedPaidOrNull(): + ChannelDirectMessagesConfigurationChanged.Paid? = this as? + dev.inmo.tgbotapi.types.ChannelDirectMessagesConfigurationChanged.Paid + +public inline fun ChatEvent.channelDirectMessagesConfigurationChangedPaidOrThrow(): + ChannelDirectMessagesConfigurationChanged.Paid = this as + dev.inmo.tgbotapi.types.ChannelDirectMessagesConfigurationChanged.Paid + +public inline fun + ChatEvent.ifChannelDirectMessagesConfigurationChangedPaid(block: (ChannelDirectMessagesConfigurationChanged.Paid) -> T): + T? = channelDirectMessagesConfigurationChangedPaidOrNull() ?.let(block) + public inline fun ChatEvent.paidMessagePriceChangedOrNull(): PaidMessagePriceChanged? = this as? dev.inmo.tgbotapi.types.PaidMessagePriceChanged diff --git a/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/WebApp.kt b/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/WebApp.kt index 4fe54301a0..8fcd60f4fc 100644 --- a/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/WebApp.kt +++ b/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/WebApp.kt @@ -144,6 +144,8 @@ external class WebApp { fun requestWriteAccess(callback: ((Boolean) -> Unit)? = definedExternally) fun requestContact(callback: ((Boolean) -> Unit)? = definedExternally) + fun hideKeyboard() + // Start of generated part @JsName("onEvent") From 6d8693a0033843b004029be24ced9fb16769e3b5 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Mon, 7 Jul 2025 22:18:16 +0600 Subject: [PATCH 12/16] add typed origin, nextTransferDate and last_resale_star_count in GiftSentOrReceived --- tgbotapi.core/api/tgbotapi.core.api | 111 +++++++++++--- .../kotlin/dev/inmo/tgbotapi/types/Common.kt | 2 + .../types/gifts/GiftSentOrReceived.kt | 140 +++++++++++++++--- 3 files changed, 218 insertions(+), 35 deletions(-) diff --git a/tgbotapi.core/api/tgbotapi.core.api b/tgbotapi.core/api/tgbotapi.core.api index 9c1aae9a31..b7cdca387c 100644 --- a/tgbotapi.core/api/tgbotapi.core.api +++ b/tgbotapi.core/api/tgbotapi.core.api @@ -10032,6 +10032,7 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field lastErrorDateField Ljava/lang/String; public static final field lastErrorMessageField Ljava/lang/String; public static final field lastNameField Ljava/lang/String; + public static final field lastResaleStarCountField Ljava/lang/String; public static final field lastSynchronizationErrorDateField Ljava/lang/String; public static final field latitudeField Ljava/lang/String; public static final field lengthField Ljava/lang/String; @@ -10078,6 +10079,7 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field newOwnerChatIdField Ljava/lang/String; public static final field newReactionField Ljava/lang/String; public static final field nextOffsetField Ljava/lang/String; + public static final field nextTransferDateField Ljava/lang/String; public static final field nonceField Ljava/lang/String; public static final field numberField Ljava/lang/String; public static final field offsetField Ljava/lang/String; @@ -19862,6 +19864,7 @@ public final class dev/inmo/tgbotapi/types/gifts/Gift$Unique$Companion { public abstract interface class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived : dev/inmo/tgbotapi/types/message/ChatEvents/abstracts/CommonEvent { public static final field Companion Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Companion; public abstract fun getGift ()Ldev/inmo/tgbotapi/types/gifts/Gift; + public abstract fun getNextTransferDate ()Ldev/inmo/tgbotapi/types/TelegramDate; public abstract fun getOwnedGiftId-FhTg01o ()Ljava/lang/String; } @@ -19889,21 +19892,23 @@ public abstract interface class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$Common : dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular { public static final field Companion Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$Common$Companion; - public fun (Ldev/inmo/tgbotapi/types/gifts/Gift$Regular;Ljava/lang/Integer;Ljava/lang/Integer;ZLjava/lang/String;Ljava/util/List;Z)V - public synthetic fun (Ldev/inmo/tgbotapi/types/gifts/Gift$Regular;Ljava/lang/Integer;Ljava/lang/Integer;ZLjava/lang/String;Ljava/util/List;ZILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun (Ldev/inmo/tgbotapi/types/gifts/Gift$Regular;Ljava/lang/Integer;Ljava/lang/Integer;ZLjava/lang/String;Ljava/util/List;ZLdev/inmo/tgbotapi/types/TelegramDate;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/gifts/Gift$Regular;Ljava/lang/Integer;Ljava/lang/Integer;ZLjava/lang/String;Ljava/util/List;ZLdev/inmo/tgbotapi/types/TelegramDate;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ldev/inmo/tgbotapi/types/gifts/Gift$Regular; public final fun component2 ()Ljava/lang/Integer; public final fun component3 ()Ljava/lang/Integer; public final fun component4 ()Z public final fun component5 ()Ljava/lang/String; public final fun component7 ()Z - public final fun copy (Ldev/inmo/tgbotapi/types/gifts/Gift$Regular;Ljava/lang/Integer;Ljava/lang/Integer;ZLjava/lang/String;Ljava/util/List;Z)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$Common; - public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$Common;Ldev/inmo/tgbotapi/types/gifts/Gift$Regular;Ljava/lang/Integer;Ljava/lang/Integer;ZLjava/lang/String;Ljava/util/List;ZILjava/lang/Object;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$Common; + public final fun component8 ()Ldev/inmo/tgbotapi/types/TelegramDate; + public final fun copy (Ldev/inmo/tgbotapi/types/gifts/Gift$Regular;Ljava/lang/Integer;Ljava/lang/Integer;ZLjava/lang/String;Ljava/util/List;ZLdev/inmo/tgbotapi/types/TelegramDate;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$Common; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$Common;Ldev/inmo/tgbotapi/types/gifts/Gift$Regular;Ljava/lang/Integer;Ljava/lang/Integer;ZLjava/lang/String;Ljava/util/List;ZLdev/inmo/tgbotapi/types/TelegramDate;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$Common; public fun equals (Ljava/lang/Object;)Z public fun getCanBeUpgraded ()Z public fun getConvertStarCount ()Ljava/lang/Integer; public fun getGift ()Ldev/inmo/tgbotapi/types/gifts/Gift$Regular; public synthetic fun getGift ()Ldev/inmo/tgbotapi/types/gifts/Gift; + public fun getNextTransferDate ()Ldev/inmo/tgbotapi/types/TelegramDate; public fun getOwnedGiftId-FhTg01o ()Ljava/lang/String; public fun getPrepaidUpgradeStarCount ()Ljava/lang/Integer; public fun getText ()Ljava/lang/String; @@ -19940,8 +19945,8 @@ public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$Comp public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$ReceivedInBusinessAccount : dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$ReceivedInBusinessAccount, dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular { public static final field Companion Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$ReceivedInBusinessAccount$Companion; - public synthetic fun (Ldev/inmo/tgbotapi/types/gifts/Gift$Regular;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;ZLjava/lang/String;Ljava/util/List;ZILkotlin/jvm/internal/DefaultConstructorMarker;)V - public synthetic fun (Ldev/inmo/tgbotapi/types/gifts/Gift$Regular;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;ZLjava/lang/String;Ljava/util/List;ZLkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/gifts/Gift$Regular;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;ZLjava/lang/String;Ljava/util/List;ZLdev/inmo/tgbotapi/types/TelegramDate;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/gifts/Gift$Regular;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;ZLjava/lang/String;Ljava/util/List;ZLdev/inmo/tgbotapi/types/TelegramDate;Lkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ldev/inmo/tgbotapi/types/gifts/Gift$Regular; public final fun component2-OyCYJok ()Ljava/lang/String; public final fun component3 ()Ljava/lang/Integer; @@ -19949,13 +19954,15 @@ public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$Rece public final fun component5 ()Z public final fun component6 ()Ljava/lang/String; public final fun component8 ()Z - public final fun copy-xVLKMpc (Ldev/inmo/tgbotapi/types/gifts/Gift$Regular;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;ZLjava/lang/String;Ljava/util/List;Z)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$ReceivedInBusinessAccount; - public static synthetic fun copy-xVLKMpc$default (Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$ReceivedInBusinessAccount;Ldev/inmo/tgbotapi/types/gifts/Gift$Regular;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;ZLjava/lang/String;Ljava/util/List;ZILjava/lang/Object;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$ReceivedInBusinessAccount; + public final fun component9 ()Ldev/inmo/tgbotapi/types/TelegramDate; + public final fun copy-3gWu8WQ (Ldev/inmo/tgbotapi/types/gifts/Gift$Regular;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;ZLjava/lang/String;Ljava/util/List;ZLdev/inmo/tgbotapi/types/TelegramDate;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$ReceivedInBusinessAccount; + public static synthetic fun copy-3gWu8WQ$default (Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$ReceivedInBusinessAccount;Ldev/inmo/tgbotapi/types/gifts/Gift$Regular;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;ZLjava/lang/String;Ljava/util/List;ZLdev/inmo/tgbotapi/types/TelegramDate;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$ReceivedInBusinessAccount; public fun equals (Ljava/lang/Object;)Z public fun getCanBeUpgraded ()Z public fun getConvertStarCount ()Ljava/lang/Integer; public fun getGift ()Ldev/inmo/tgbotapi/types/gifts/Gift$Regular; public synthetic fun getGift ()Ldev/inmo/tgbotapi/types/gifts/Gift; + public fun getNextTransferDate ()Ldev/inmo/tgbotapi/types/TelegramDate; public synthetic fun getOwnedGiftId-FhTg01o ()Ljava/lang/String; public fun getOwnedGiftId-OyCYJok ()Ljava/lang/String; public fun getPrepaidUpgradeStarCount ()Ljava/lang/Integer; @@ -19983,23 +19990,32 @@ public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$Rece public abstract interface class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique : dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived { public static final field Companion Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Companion; public abstract fun getGift ()Ldev/inmo/tgbotapi/types/gifts/Gift$Unique; + public abstract fun getLastResaleStarCount ()Ljava/lang/Integer; public abstract fun getOrigin ()Ljava/lang/String; + public abstract fun getOriginTyped ()Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin; public abstract fun getTransferStarCount ()Ljava/lang/Integer; } public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Common : dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique { public static final field Companion Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Common$Companion; - public fun (Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ljava/lang/String;Ljava/lang/Integer;)V - public synthetic fun (Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ljava/lang/String;Ljava/lang/Integer;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun (Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin;Ljava/lang/Integer;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin;Ljava/lang/Integer;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun (Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ldev/inmo/tgbotapi/types/gifts/Gift$Unique; - public final fun component2 ()Ljava/lang/String; + public final fun component2 ()Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin; public final fun component3 ()Ljava/lang/Integer; - public final fun copy (Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ljava/lang/String;Ljava/lang/Integer;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Common; - public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Common;Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ljava/lang/String;Ljava/lang/Integer;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Common; + public final fun component4 ()Ljava/lang/Integer; + public final fun component5 ()Ldev/inmo/tgbotapi/types/TelegramDate; + public final fun copy (Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin;Ljava/lang/Integer;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Common; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Common;Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin;Ljava/lang/Integer;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Common; public fun equals (Ljava/lang/Object;)Z public fun getGift ()Ldev/inmo/tgbotapi/types/gifts/Gift$Unique; public synthetic fun getGift ()Ldev/inmo/tgbotapi/types/gifts/Gift; + public fun getLastResaleStarCount ()Ljava/lang/Integer; + public fun getNextTransferDate ()Ldev/inmo/tgbotapi/types/TelegramDate; public fun getOrigin ()Ljava/lang/String; + public fun getOriginTyped ()Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin; public fun getOwnedGiftId-FhTg01o ()Ljava/lang/String; public fun getTransferStarCount ()Ljava/lang/Integer; public fun hashCode ()I @@ -20031,20 +20047,79 @@ public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Compa public final fun serializer ()Lkotlinx/serialization/KSerializer; } +public abstract interface class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin { + public static final field Companion Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin$Companion; + public abstract fun getString ()Ljava/lang/String; +} + +public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin$Companion : kotlinx/serialization/KSerializer { + public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun fromString (Ljava/lang/String;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin; + public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin$Resale : dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin$Resale; + public fun getString ()Ljava/lang/String; + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin$Transfer : dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin$Transfer; + public fun getString ()Ljava/lang/String; + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin$Unknown : dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin { + public static final field Companion Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin$Unknown$Companion; + public static final synthetic fun box-impl (Ljava/lang/String;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin$Unknown; + public static fun constructor-impl (Ljava/lang/String;)Ljava/lang/String; + public fun equals (Ljava/lang/Object;)Z + public static fun equals-impl (Ljava/lang/String;Ljava/lang/Object;)Z + public static final fun equals-impl0 (Ljava/lang/String;Ljava/lang/String;)Z + public fun getString ()Ljava/lang/String; + public fun hashCode ()I + public static fun hashCode-impl (Ljava/lang/String;)I + public fun toString ()Ljava/lang/String; + public static fun toString-impl (Ljava/lang/String;)Ljava/lang/String; + public final synthetic fun unbox-impl ()Ljava/lang/String; +} + +public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin$Unknown$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin$Upgrade : dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin$Upgrade; + public fun getString ()Ljava/lang/String; + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$ReceivedInBusinessAccount : dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$ReceivedInBusinessAccount, dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique { public static final field Companion Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$ReceivedInBusinessAccount$Companion; - public synthetic fun (Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public synthetic fun (Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ljava/lang/String;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin;Ljava/lang/Integer;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ljava/lang/String;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin;Ljava/lang/Integer;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;Lkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ldev/inmo/tgbotapi/types/gifts/Gift$Unique; public final fun component2-OyCYJok ()Ljava/lang/String; - public final fun component3 ()Ljava/lang/String; + public final fun component3 ()Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin; public final fun component4 ()Ljava/lang/Integer; - public final fun copy-A6CMM0Q (Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$ReceivedInBusinessAccount; - public static synthetic fun copy-A6CMM0Q$default (Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$ReceivedInBusinessAccount;Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$ReceivedInBusinessAccount; + public final fun component5 ()Ljava/lang/Integer; + public final fun component6 ()Ldev/inmo/tgbotapi/types/TelegramDate; + public final fun copy-gWCrhmI (Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ljava/lang/String;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin;Ljava/lang/Integer;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$ReceivedInBusinessAccount; + public static synthetic fun copy-gWCrhmI$default (Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$ReceivedInBusinessAccount;Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ljava/lang/String;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin;Ljava/lang/Integer;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$ReceivedInBusinessAccount; public fun equals (Ljava/lang/Object;)Z public fun getGift ()Ldev/inmo/tgbotapi/types/gifts/Gift$Unique; public synthetic fun getGift ()Ldev/inmo/tgbotapi/types/gifts/Gift; + public fun getLastResaleStarCount ()Ljava/lang/Integer; + public fun getNextTransferDate ()Ldev/inmo/tgbotapi/types/TelegramDate; public fun getOrigin ()Ljava/lang/String; + public fun getOriginTyped ()Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin; public synthetic fun getOwnedGiftId-FhTg01o ()Ljava/lang/String; public fun getOwnedGiftId-OyCYJok ()Ljava/lang/String; public fun getTransferStarCount ()Ljava/lang/Integer; diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt index 68b97f7d7e..7f4831a1a6 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt @@ -534,7 +534,9 @@ const val convertStarCountField = "convert_star_count" const val prepaidUpgradeStarCountField = "prepaid_upgrade_star_count" const val canBeUpgradedField = "can_be_upgraded" const val isPrivateField = "is_private" +const val nextTransferDateField = "next_transfer_date" const val transferStarCountField = "transfer_star_count" +const val lastResaleStarCountField = "last_resale_star_count" const val newOwnerChatIdField = "new_owner_chat_id" const val pointField = "point" diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived.kt index 8ae20fae10..1ec9385b03 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived.kt @@ -2,6 +2,7 @@ package dev.inmo.tgbotapi.types.gifts import dev.inmo.tgbotapi.abstracts.TextedInput import dev.inmo.tgbotapi.types.* +import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceived.Unique.Common import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.CommonEvent import dev.inmo.tgbotapi.types.message.RawMessageEntities import dev.inmo.tgbotapi.types.message.asTextSources @@ -9,17 +10,21 @@ import dev.inmo.tgbotapi.types.message.textsources.TextSource import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.message.toRawMessageEntities import dev.inmo.tgbotapi.utils.internal.ClassCastsIncluded +import kotlinx.serialization.EncodeDefault import kotlinx.serialization.KSerializer import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable +import kotlinx.serialization.Transient +import kotlinx.serialization.builtins.serializer import kotlinx.serialization.descriptors.SerialDescriptor import kotlinx.serialization.encoding.Decoder import kotlinx.serialization.encoding.Encoder +import kotlin.jvm.JvmInline import kotlin.jvm.JvmName /** - * Represent Telegram Bots API abstraction [GiftInfo](https://core.telegram.org/bots/api#giftinfo) and + * Represent Telegram Bots API abstraction [OwnedGiftUnique](https://core.telegram.org/bots/api#giftinfo) and * [UniqueGiftInfo](https://core.telegram.org/bots/api#uniquegiftinfo) * * @see ReceivedInBusinessAccount @@ -32,6 +37,7 @@ import kotlin.jvm.JvmName sealed interface GiftSentOrReceived : CommonEvent { val ownedGiftId: GiftId? val gift: Gift + val nextTransferDate: TelegramDate? @Serializable sealed interface ReceivedInBusinessAccount : GiftSentOrReceived { @@ -61,7 +67,9 @@ sealed interface GiftSentOrReceived : CommonEvent { @SerialName(entitiesField) private val entities: RawMessageEntities? = null, @SerialName(isPrivateField) - override val isPrivate: Boolean = false + override val isPrivate: Boolean = false, + @SerialName(nextTransferDateField) + override val nextTransferDate: TelegramDate? = null ) : Regular { override val textSources: List by lazy { entities ?.asTextSources(text ?: return@lazy emptyList()) ?: emptyList() @@ -87,7 +95,9 @@ sealed interface GiftSentOrReceived : CommonEvent { @SerialName(entitiesField) private val entities: RawMessageEntities? = null, @SerialName(isPrivateField) - override val isPrivate: Boolean = false + override val isPrivate: Boolean = false, + @SerialName(nextTransferDateField) + override val nextTransferDate: TelegramDate? = null ) : Regular, GiftSentOrReceived.ReceivedInBusinessAccount { override val textSources: List by lazy { entities ?.asTextSources(text ?: return@lazy emptyList()) ?: emptyList() @@ -112,7 +122,9 @@ sealed interface GiftSentOrReceived : CommonEvent { @SerialName(entitiesField) val entities: RawMessageEntities? = null, @SerialName(isPrivateField) - val isPrivate: Boolean = false + val isPrivate: Boolean = false, + @SerialName(nextTransferDateField) + val nextTransferDate: TelegramDate? = null ) override val descriptor: SerialDescriptor @@ -137,7 +149,8 @@ sealed interface GiftSentOrReceived : CommonEvent { canBeUpgraded = surrogate.canBeUpgraded, text = surrogate.text, entities = surrogate.entities, - isPrivate = surrogate.isPrivate + isPrivate = surrogate.isPrivate, + nextTransferDate = surrogate.nextTransferDate ) } else -> { @@ -149,7 +162,8 @@ sealed interface GiftSentOrReceived : CommonEvent { canBeUpgraded = surrogate.canBeUpgraded, text = surrogate.text, entities = surrogate.entities, - isPrivate = surrogate.isPrivate + isPrivate = surrogate.isPrivate, + nextTransferDate = surrogate.nextTransferDate ) } } @@ -192,19 +206,80 @@ sealed interface GiftSentOrReceived : CommonEvent { sealed interface Unique : GiftSentOrReceived { override val gift: Gift.Unique val origin: String? + val originTyped: Origin? + val lastResaleStarCount: Int? val transferStarCount: Int? + @Suppress("SERIALIZER_TYPE_INCOMPATIBLE") + @Serializable(Origin.Companion::class) + sealed interface Origin { + val string: String + @Serializable(Origin.Companion::class) + object Upgrade : Origin { override val string: String = "upgrade" } + @Serializable(Origin.Companion::class) + object Transfer : Origin { override val string: String = "transfer" } + @Serializable(Origin.Companion::class) + object Resale : Origin { override val string: String = "resale" } + @Serializable(Origin.Companion::class) + @JvmInline + value class Unknown(override val string: String) : Origin + + companion object : KSerializer { + override val descriptor: SerialDescriptor = String.serializer().descriptor + + fun fromString(value: String): Origin = when (value) { + Upgrade.string -> Upgrade + Transfer.string -> Transfer + Resale.string -> Resale + else -> Unknown(value) + } + + override fun deserialize(decoder: Decoder): Origin { + val value = decoder.decodeString() + return fromString(value) + } + + override fun serialize( + encoder: Encoder, + value: Origin + ) { + encoder.encodeString(value.string) + } + } + } + @Serializable data class Common( @SerialName(giftField) override val gift: Gift.Unique, @SerialName(originField) - override val origin: String? = null, + override val originTyped: Origin? = null, + @SerialName(lastResaleStarCountField) + override val lastResaleStarCount: Int? = null, @SerialName(transferStarCountField) - override val transferStarCount: Int? = null + override val transferStarCount: Int? = null, + @SerialName(nextTransferDateField) + override val nextTransferDate: TelegramDate? = null ) : Unique { override val ownedGiftId: GiftId? get() = null + + @Transient + override val origin: String? = originTyped ?.string + + constructor( + gift: Gift.Unique, + origin: String?, + lastResaleStarCount: Int? = null, + transferStarCount: Int? = null, + nextTransferDate: TelegramDate? = null + ) : this( + gift, + origin ?.let { Origin.fromString(it) }, + lastResaleStarCount, + transferStarCount, + nextTransferDate + ) } @Serializable @@ -214,10 +289,33 @@ sealed interface GiftSentOrReceived : CommonEvent { @SerialName(ownedGiftIdField) override val ownedGiftId: GiftId, @SerialName(originField) - override val origin: String? = null, + override val originTyped: Origin? = null, + @SerialName(lastResaleStarCountField) + override val lastResaleStarCount: Int? = null, @SerialName(transferStarCountField) - override val transferStarCount: Int? = null - ) : Unique, GiftSentOrReceived.ReceivedInBusinessAccount + override val transferStarCount: Int? = null, + @SerialName(nextTransferDateField) + override val nextTransferDate: TelegramDate? = null + ) : Unique, GiftSentOrReceived.ReceivedInBusinessAccount { + @Transient + override val origin: String? = originTyped ?.string + + constructor( + gift: Gift.Unique, + ownedGiftId: GiftId, + origin: String? = null, + lastResaleStarCount: Int? = null, + transferStarCount: Int? = null, + nextTransferDate: TelegramDate? = null + ) : this( + gift = gift, + ownedGiftId = ownedGiftId, + originTyped = origin ?.let { Origin.fromString(it) }, + lastResaleStarCount = lastResaleStarCount, + transferStarCount = transferStarCount, + nextTransferDate = nextTransferDate + ) + } companion object : KSerializer { @Serializable @@ -227,9 +325,13 @@ sealed interface GiftSentOrReceived : CommonEvent { @SerialName(ownedGiftIdField) val ownedGiftId: GiftId? = null, @SerialName(originField) - val origin: String? = null, + val origin: Origin? = null, + @SerialName(lastResaleStarCountField) + val lastResaleStarCount: Int? = null, @SerialName(transferStarCountField) - val transferStarCount: Int? = null + val transferStarCount: Int? = null, + @SerialName(nextTransferDateField) + val nextTransferDate: TelegramDate? = null ) override val descriptor: SerialDescriptor @@ -249,16 +351,20 @@ sealed interface GiftSentOrReceived : CommonEvent { surrogate.ownedGiftId == null -> { Common( gift = surrogate.gift, - origin = surrogate.origin, - transferStarCount = surrogate.transferStarCount + originTyped = surrogate.origin, + lastResaleStarCount = surrogate.lastResaleStarCount, + transferStarCount = surrogate.transferStarCount, + nextTransferDate = surrogate.nextTransferDate ) } else -> { ReceivedInBusinessAccount( gift = surrogate.gift, ownedGiftId = surrogate.ownedGiftId, - origin = surrogate.origin, - transferStarCount = surrogate.transferStarCount + originTyped = surrogate.origin, + lastResaleStarCount = surrogate.lastResaleStarCount, + transferStarCount = surrogate.transferStarCount, + nextTransferDate = surrogate.nextTransferDate ) } } From 69a9e8f82038eb91296565ccb4d99eae601278f4 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Tue, 8 Jul 2025 11:43:13 +0600 Subject: [PATCH 13/16] several fixes --- .../api/tgbotapi.behaviour_builder.api | 4 +++ .../expectations/WaitEditedContent.kt | 5 ++++ .../EditedContentTriggers.kt | 28 +++++++++++++++++++ .../types/checklists/ChecklistTasksAdded.kt | 4 +++ .../types/checklists/ChecklistTasksDone.kt | 2 ++ .../inmo/tgbotapi/types/message/RawMessage.kt | 3 ++ .../types/message/content/Typealiases.kt | 1 + 7 files changed, 47 insertions(+) diff --git a/tgbotapi.behaviour_builder/api/tgbotapi.behaviour_builder.api b/tgbotapi.behaviour_builder/api/tgbotapi.behaviour_builder.api index 69e311efa2..e729c14dd0 100644 --- a/tgbotapi.behaviour_builder/api/tgbotapi.behaviour_builder.api +++ b/tgbotapi.behaviour_builder/api/tgbotapi.behaviour_builder.api @@ -506,6 +506,8 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W public static synthetic fun waitEditedAudio$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static final fun waitEditedAudioMediaGroupContent (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; public static synthetic fun waitEditedAudioMediaGroupContent$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; + public static final fun waitEditedChecklistContent (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; + public static synthetic fun waitEditedChecklistContent$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static final fun waitEditedContact (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; public static synthetic fun waitEditedContact$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static final fun waitEditedContentMessage (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; @@ -1283,6 +1285,8 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handl public static synthetic fun onEditedAudio$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static final fun onEditedAudioMediaGroup (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static synthetic fun onEditedAudioMediaGroup$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; + public static final fun onEditedChecklist (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; + public static synthetic fun onEditedChecklist$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static final fun onEditedContact (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static synthetic fun onEditedContact$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static final fun onEditedContentMessage (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEditedContent.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEditedContent.kt index b41a87811b..133c86af7d 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEditedContent.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEditedContent.kt @@ -128,3 +128,8 @@ fun BehaviourContext.waitEditedGiveawayPublicResultsContent( errorFactory: NullableRequestBuilder<*> = { null } ) = waitEditedContent(initRequest, errorFactory) +fun BehaviourContext.waitEditedChecklistContent( + initRequest: Request<*>? = null, + errorFactory: NullableRequestBuilder<*> = { null } +) = waitEditedContent(initRequest, errorFactory) + diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EditedContentTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EditedContentTriggers.kt index 9321510cae..ff0de098bc 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EditedContentTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EditedContentTriggers.kt @@ -591,3 +591,31 @@ fun BC.onEditedInvoice( additionalSubcontextInitialAction, scenarioReceiver ) + + +/** + * @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call + * @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example, + * this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage]. + * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. + * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] + * to combinate several filters + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that + * data + */ +fun BC.onEditedChecklist( + initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, + subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, + additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver? = null, + scenarioReceiver: CustomBehaviourContextAndTypeReceiver +)= onEditedContent( + initialFilter, + subcontextUpdatesFilter, + markerFactory, + additionalSubcontextInitialAction, + scenarioReceiver +) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/ChecklistTasksAdded.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/ChecklistTasksAdded.kt index 0fa05967ff..21ce951edd 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/ChecklistTasksAdded.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/ChecklistTasksAdded.kt @@ -4,7 +4,10 @@ import dev.inmo.tgbotapi.types.checklistMessageField import dev.inmo.tgbotapi.types.markedAsDoneTaskIdsField import dev.inmo.tgbotapi.types.markedAsNotDoneTaskIdsField import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.CommonEvent +import dev.inmo.tgbotapi.types.message.RawMessage import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage +import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass +import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializeOnlySerializerClass import dev.inmo.tgbotapi.types.message.content.ChecklistContent import dev.inmo.tgbotapi.types.tasksField import dev.inmo.tgbotapi.types.userField @@ -14,6 +17,7 @@ import kotlinx.serialization.Serializable @Serializable data class ChecklistTasksAdded( @SerialName(checklistMessageField) + @Serializable(TelegramBotAPIMessageDeserializeOnlySerializerClass::class) val checklistMessage: CommonMessage, @SerialName(tasksField) val tasks: List, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/ChecklistTasksDone.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/ChecklistTasksDone.kt index a2fe468d8a..369f1aa67b 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/ChecklistTasksDone.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/ChecklistTasksDone.kt @@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.types.markedAsDoneTaskIdsField import dev.inmo.tgbotapi.types.markedAsNotDoneTaskIdsField import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.CommonEvent import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage +import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializeOnlySerializerClass import dev.inmo.tgbotapi.types.message.content.ChecklistContent import dev.inmo.tgbotapi.types.userField import kotlinx.serialization.SerialName @@ -13,6 +14,7 @@ import kotlinx.serialization.Serializable @Serializable data class ChecklistTasksDone( @SerialName(checklistMessageField) + @Serializable(TelegramBotAPIMessageDeserializeOnlySerializerClass::class) val checklistMessage: CommonMessage, @SerialName(markedAsDoneTaskIdsField) val markedAsDone: List? = null, 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 4f5b5134d2..53d0d8f698 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 @@ -6,6 +6,7 @@ import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup import dev.inmo.tgbotapi.types.chat.* import dev.inmo.tgbotapi.types.chat.CommonBot import dev.inmo.tgbotapi.types.chat.User +import dev.inmo.tgbotapi.types.checklists.Checklist import dev.inmo.tgbotapi.types.checklists.ChecklistTasksAdded import dev.inmo.tgbotapi.types.checklists.ChecklistTasksDone import dev.inmo.tgbotapi.types.dice.Dice @@ -168,6 +169,7 @@ internal data class RawMessage( private val giveaway_completed: GiveawayPrivateResults? = null, // Checklists + private val checklist: Checklist.Created? = null, private val checklist_tasks_done: ChecklistTasksDone? = null, private val checklist_tasks_added: ChecklistTasksAdded? = null, @@ -249,6 +251,7 @@ internal data class RawMessage( venue != null -> VenueContent(venue) poll != null -> PollContent(poll) invoice != null -> InvoiceContent(invoice) + checklist != null -> ChecklistContent(checklist) giveaway != null -> GiveawayContent(chat, messageId, giveaway) giveaway_winners is GiveawayPublicResults -> GiveawayPublicResultsContent(giveaway_winners) else -> null diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/Typealiases.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/Typealiases.kt index 548291cd5c..db0d24576e 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/Typealiases.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/Typealiases.kt @@ -35,5 +35,6 @@ typealias AnimationMessage = CommonMessage typealias ScheduledGiveawayContentMessage = CommonMessage typealias GiveawayPublicResultsContentMessage = CommonMessage typealias PaidMediaInfoContentMessage = CommonMessage +typealias ChecklistMessage = CommonMessage From 6d5bedd315dc35c94e9d6fa6d61632f5e21e6085 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Tue, 8 Jul 2025 11:47:05 +0600 Subject: [PATCH 14/16] add workarounds for checklists --- .../api/tgbotapi.behaviour_builder.api | 4 +++ .../expectations/WaitEditedContentMessage.kt | 6 ++++ .../triggers_handling/ContentTriggers.kt | 30 +++++++++++++++++++ 3 files changed, 40 insertions(+) diff --git a/tgbotapi.behaviour_builder/api/tgbotapi.behaviour_builder.api b/tgbotapi.behaviour_builder/api/tgbotapi.behaviour_builder.api index e729c14dd0..2091d4e8bd 100644 --- a/tgbotapi.behaviour_builder/api/tgbotapi.behaviour_builder.api +++ b/tgbotapi.behaviour_builder/api/tgbotapi.behaviour_builder.api @@ -565,6 +565,8 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W public static synthetic fun waitEditedAudioMediaGroupContentMessage$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static final fun waitEditedAudioMessage (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; public static synthetic fun waitEditedAudioMessage$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; + public static final fun waitEditedChecklistMessage (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; + public static synthetic fun waitEditedChecklistMessage$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static final fun waitEditedContactMessage (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; public static synthetic fun waitEditedContactMessage$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static final fun waitEditedDiceMessage (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; @@ -1204,6 +1206,8 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handl public static synthetic fun onAudio$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static final fun onAudioMediaGroup (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static synthetic fun onAudioMediaGroup$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; + public static final fun onChecklistContent (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; + public static synthetic fun onChecklistContent$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static final fun onContact (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static synthetic fun onContact$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static final fun onContentMessage (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEditedContentMessage.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEditedContentMessage.kt index 47bd49db37..850080194d 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEditedContentMessage.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEditedContentMessage.kt @@ -141,3 +141,9 @@ fun BehaviourContext.waitEditedGiveawayPublicResultsContentMessage( errorFactory: NullableRequestBuilder<*> = { null } ) = waitEditedContentMessage(initRequest, errorFactory) + +fun BehaviourContext.waitEditedChecklistMessage( + initRequest: Request<*>? = null, + errorFactory: NullableRequestBuilder<*> = { null } +) = waitEditedContentMessage(initRequest, errorFactory) + diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ContentTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ContentTriggers.kt index f40bea4e7d..eed9ebd499 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ContentTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ContentTriggers.kt @@ -899,3 +899,33 @@ fun BC.onPaidMediaInfoContent( additionalSubcontextInitialAction, scenarioReceiver ) + + + + +/** + * @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call + * @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example, + * this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage]. + * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. + * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] + * to combinate several filters + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that + * data + */ +fun BC.onChecklistContent( + initialFilter: CommonMessageFilter? = null, + subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, + additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver? = null, + scenarioReceiver: CustomBehaviourContextAndTypeReceiver +) = onContentMessageWithType( + initialFilter, + subcontextUpdatesFilter, + markerFactory, + additionalSubcontextInitialAction, + scenarioReceiver +) From 3857950141100d4f1562e812110bc31c6f5f2aca Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Tue, 8 Jul 2025 18:38:12 +0600 Subject: [PATCH 15/16] fixes --- tgbotapi.core/api/tgbotapi.core.api | 26 +++++-------------- .../types/DirectMessagePriceChanged.kt | 13 +++++----- .../tgbotapi/types/checklists/Checklist.kt | 2 +- 3 files changed, 14 insertions(+), 27 deletions(-) diff --git a/tgbotapi.core/api/tgbotapi.core.api b/tgbotapi.core/api/tgbotapi.core.api index b7cdca387c..cf5f6aaa01 100644 --- a/tgbotapi.core/api/tgbotapi.core.api +++ b/tgbotapi.core/api/tgbotapi.core.api @@ -9403,16 +9403,22 @@ public final class dev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationCha public final class dev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Disabled : dev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged { public static final field INSTANCE Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Disabled; + public fun equals (Ljava/lang/Object;)Z public fun getCost ()Ljava/lang/Integer; public fun getEnabled ()Z + public fun hashCode ()I public final fun serializer ()Lkotlinx/serialization/KSerializer; + public fun toString ()Ljava/lang/String; } public final class dev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Free : dev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged { public static final field INSTANCE Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Free; + public fun equals (Ljava/lang/Object;)Z public fun getCost ()Ljava/lang/Integer; public fun getEnabled ()Z + public fun hashCode ()I public final fun serializer ()Lkotlinx/serialization/KSerializer; + public fun toString ()Ljava/lang/String; } public final class dev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Paid : dev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged { @@ -9428,16 +9434,6 @@ public final class dev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationCha public fun toString ()Ljava/lang/String; } -public synthetic class dev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Paid$$serializer : kotlinx/serialization/internal/GeneratedSerializer { - public static final field INSTANCE Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Paid$$serializer; - public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; - public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Paid; - public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; - public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; - public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Paid;)V - public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V -} - public final class dev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Paid$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -17849,16 +17845,6 @@ public final class dev/inmo/tgbotapi/types/checklists/Checklist$Input : dev/inmo public fun toString ()Ljava/lang/String; } -public synthetic class dev/inmo/tgbotapi/types/checklists/Checklist$Input$$serializer : kotlinx/serialization/internal/GeneratedSerializer { - public static final field INSTANCE Ldev/inmo/tgbotapi/types/checklists/Checklist$Input$$serializer; - public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; - public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/checklists/Checklist$Input; - public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; - public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; - public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/checklists/Checklist$Input;)V - public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V -} - public final class dev/inmo/tgbotapi/types/checklists/Checklist$Input$Companion : kotlinx/serialization/KSerializer { public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/checklists/Checklist$Input; public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/DirectMessagePriceChanged.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/DirectMessagePriceChanged.kt index 403f9a72c4..ebcb8eb5fb 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/DirectMessagePriceChanged.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/DirectMessagePriceChanged.kt @@ -7,25 +7,26 @@ import kotlinx.serialization.descriptors.SerialDescriptor import kotlinx.serialization.encoding.Decoder import kotlinx.serialization.encoding.Encoder -@Serializable +@Suppress("SERIALIZER_TYPE_INCOMPATIBLE") +@Serializable(ChannelDirectMessagesConfigurationChanged.Companion::class) sealed interface ChannelDirectMessagesConfigurationChanged : ChannelEvent { val enabled: Boolean val cost: Int? - @Serializable - object Disabled : ChannelDirectMessagesConfigurationChanged { + @Serializable(ChannelDirectMessagesConfigurationChanged.Companion::class) + data object Disabled : ChannelDirectMessagesConfigurationChanged { override val enabled: Boolean get() = false override val cost: Int? get() = null } - @Serializable - object Free : ChannelDirectMessagesConfigurationChanged { + @Serializable(ChannelDirectMessagesConfigurationChanged.Companion::class) + data object Free : ChannelDirectMessagesConfigurationChanged { override val enabled: Boolean get() = true override val cost: Int get() = 0 } - @Serializable + @Serializable(ChannelDirectMessagesConfigurationChanged.Companion::class) data class Paid( override val cost: Int ) : ChannelDirectMessagesConfigurationChanged { diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/Checklist.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/Checklist.kt index e85509049b..9a48e7f329 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/Checklist.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/Checklist.kt @@ -30,7 +30,7 @@ sealed interface Checklist : TitledInput { val tasks: List val othersCanAddTasks: Boolean val othersCanCompleteTasks: Boolean - @Serializable + @Serializable(Input.Companion::class) data class Input @Warning("It is low level API. Do not use it without need") constructor( @SerialName(titleField) override val title: String, From 2ecd42c859f0901007f53229c19f5e4811796ce7 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 10 Jul 2025 16:13:19 +0600 Subject: [PATCH 16/16] fill changelog (-.-) and remove redundant file --- CHANGELOG.md | 4 ++++ .../tgbotapi/types/checklists/InputChecklist.kt | 15 --------------- 2 files changed, 4 insertions(+), 15 deletions(-) delete mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/InputChecklist.kt diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a8f6819ce..e5f9db9148 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## 26.1.0 +**THIS UPDATE CONTAINS ADDING SUPPORT OF [Telegram Bots API 9.1](https://core.telegram.org/bots/api-changelog#july-3-2025)** + +**THIS UPDATE _MAY_ CONTAINS BREAKING CHANGES** + ## 26.0.0 **THIS UPDATE CONTAINS BREAKING CHANGES IN BEHAVIOUR BUILDER AND CORE. BE CAREFUL ON UPDATE** diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/InputChecklist.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/InputChecklist.kt deleted file mode 100644 index 1baf755a5f..0000000000 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/checklists/InputChecklist.kt +++ /dev/null @@ -1,15 +0,0 @@ -package dev.inmo.tgbotapi.types.checklists - -import dev.inmo.micro_utils.common.Warning -import dev.inmo.tgbotapi.abstracts.TextedInput -import dev.inmo.tgbotapi.abstracts.TitledInput -import dev.inmo.tgbotapi.types.message.ParseMode -import dev.inmo.tgbotapi.types.message.parseModeField -import dev.inmo.tgbotapi.types.message.textsources.TextSource -import dev.inmo.tgbotapi.types.tasksField -import dev.inmo.tgbotapi.types.titleEntitiesField -import dev.inmo.tgbotapi.types.titleField -import kotlinx.serialization.SerialName -import kotlinx.serialization.Serializable - -