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

add ChecklistTasksAdded and ChecklistTasksDone events

This commit is contained in:
2025-07-07 21:19:17 +06:00
parent e53b3b8198
commit db8bac9b52
10 changed files with 204 additions and 2 deletions

View File

@@ -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;

View File

@@ -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<GiftSentOrReceived.Unique>(initRequest, errorFactory)
fun BehaviourContext.waitChecklistTasksDone(
initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null }
) = waitEvents<ChecklistTasksDone>(initRequest, errorFactory)
fun BehaviourContext.waitChecklistTasksAdded(
initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null }
) = waitEvents<ChecklistTasksAdded>(initRequest, errorFactory)

View File

@@ -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 : BehaviourContext> BC.onUniqueGiftSentOrReceived(
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChatEventMessage<GiftSentOrReceived.Unique>>? = null,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<GiftSentOrReceived.Unique>>
) = 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 : BehaviourContext> BC.onChecklistTasksDone(
initialFilter: SimpleFilter<ChatEventMessage<ChecklistTasksDone>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<ChecklistTasksDone>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<ChecklistTasksDone>, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChatEventMessage<ChecklistTasksDone>>? = null,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<ChecklistTasksDone>>
) = 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 : BehaviourContext> BC.onChecklistTasksAdded(
initialFilter: SimpleFilter<ChatEventMessage<ChecklistTasksAdded>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<ChecklistTasksAdded>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<ChecklistTasksAdded>, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChatEventMessage<ChecklistTasksAdded>>? = null,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<ChecklistTasksAdded>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)

View File

@@ -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 <init> (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 <init> (Ldev/inmo/tgbotapi/types/message/abstracts/CommonMessage;Ljava/util/List;Ljava/util/List;)V
public synthetic fun <init> (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;

View File

@@ -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"

View File

@@ -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<ChecklistContent>,
@SerialName(tasksField)
val tasks: List<ChecklistTask.Created>,
) : CommonEvent

View File

@@ -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<ChecklistContent>,
@SerialName(markedAsDoneTaskIdsField)
val markedAsDone: List<ChecklistTaskId>? = null,
@SerialName(markedAsNotDoneTaskIdsField)
val markedAsNotDone: List<ChecklistTaskId>? = null,
) : CommonEvent

View File

@@ -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
}
}

View File

@@ -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;

View File

@@ -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 <T> 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 <T> 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 <T> ChatEvent.ifChecklistTasksDone(block: (ChecklistTasksDone) -> T): T? =
checklistTasksDoneOrNull() ?.let(block)
public inline fun ChatEvent.giftSentOrReceivedOrNull(): GiftSentOrReceived? = this as?
dev.inmo.tgbotapi.types.gifts.GiftSentOrReceived