1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2025-11-30 11:25:44 +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

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