telegramsjs
    Preparing search index...

    Class InputChecklistBuilder

    Builder for creating Telegram checklist inputs

    const checklist = new InputChecklistBuilder()
    .setTitle('My Checklist')
    .addTask('Task 1')
    .addTask('Task 2')
    .setOthersCanAddTasks(true);
    Index

    Constructors

    Properties

    data: Partial<InputChecklist>

    Methods

    • Add a single task to the checklist

      Parameters

      • text: string

        Task text (1-100 characters)

      • Optionaloptions: { entities?: MessageEntity[]; id?: number; parseMode?: ParseMode }

        Optional task configuration

      Returns this

    • Add multiple tasks at once

      Parameters

      • ...tasks: (
            | string
            | InputChecklistTask
            | {
                entities?: MessageEntity[];
                id?: number;
                parseMode?: ParseMode;
                text: string;
            }
        )[]

        Array of task definitions

      Returns this

    • Clear all tasks

      Returns this

    • Get task count

      Returns number

    • Remove a task by ID

      Parameters

      • id: number

        Task ID to remove

      Returns this

    • Set whether others can add tasks

      Parameters

      • OptionalcanAdd: boolean

        Whether others can add tasks

      Returns this

    • Set whether others can mark tasks as done

      Parameters

      • OptionalcanMark: boolean

        Whether others can mark tasks as done

      Returns this

    • Set the parse mode for the title

      Parameters

      • parseMode: ParseMode

        Parse mode to use

      Returns this

    • Set the checklist title

      Parameters

      • title: string

        Title text (1-255 characters)

      • OptionalparseMode: ParseMode

        Optional parse mode

      • Optionalentities: MessageEntity[]

        Optional title entities

      Returns this

    • Set title entities

      Parameters

      Returns this

    • Update an existing task

      Parameters

      • id: number

        Task ID to update

      • updates: Partial<Omit<InputChecklistTask, "id">>

        Partial task updates

      Returns this

    • Create a task object

      Parameters

      • text: string

        Task text

      • id: number

        Task ID

      • Optionaloptions: { entities?: MessageEntity[]; parseMode?: ParseMode }

        Optional task configuration

      Returns InputChecklistTask