@japofc/baileys - v2.4.7
    Preparing search index...

    Interface Attendance

    interface Attendance {
        size: number;
        bind(sock: unknown): () => void;
        checkIn(chat: string, user: string, at?: number): number | null;
        clear(): void;
        close(
            chat: string,
        ):
            | {
                attendees: Attendee[];
                chat: string;
                closedAt: number;
                openedAt: number;
                title: string;
            }
            | null;
        getAttendees(chat: string): Attendee[];
        getMentions(chat: string): string[];
        getMissing(
            chat: string,
            participants: (string | { id?: string })[],
        ): string[];
        getStreak(chat: string, user: string): number;
        handler(upsert: { messages: unknown[] }): void;
        isOpen(chat: string): boolean;
        load(snapshot: Record<string, unknown>): void;
        onCheckIn(
            cb: (
                info: {
                    at: number;
                    chat: string;
                    position: number;
                    streak: number;
                    user: string;
                },
            ) => void,
        ): () => void;
        open(
            chat: string,
            options?: { openedBy?: string; title?: string },
        ): { chat: string; keyword: string; title: string };
        render(chat: string): string | null;
        renderSummary(
            closed:
                | {
                    attendees: Attendee[];
                    closedAt: number;
                    openedAt: number;
                    title: string;
                }
                | null,
        ): string
        | null;
        toJSON(): Record<string, unknown>;
        unbind(): void;
    }
    Index
    size: number
    • Check a user in. Returns their 1-based position, or null.

      Parameters

      • chat: string
      • user: string
      • Optionalat: number

      Returns number | null

    • Close and return the final list.

      Parameters

      • chat: string

      Returns
          | {
              attendees: Attendee[];
              chat: string;
              closedAt: number;
              openedAt: number;
              title: string;
          }
          | null

    • Participants who have NOT checked in.

      Parameters

      • chat: string
      • participants: (string | { id?: string })[]

      Returns string[]

    • Consecutive-day attendance streak for a user.

      Parameters

      • chat: string
      • user: string

      Returns number

    • Parameters

      • upsert: { messages: unknown[] }

      Returns void

    • Restore a toJSON() snapshot (streaks survive restarts).

      Parameters

      • snapshot: Record<string, unknown>

      Returns void

    • Parameters

      • cb: (
            info: {
                at: number;
                chat: string;
                position: number;
                streak: number;
                user: string;
            },
        ) => void

      Returns () => void

    • Parameters

      • chat: string
      • Optionaloptions: { openedBy?: string; title?: string }

      Returns { chat: string; keyword: string; title: string }

    • Ready-to-send numbered list with check-in times.

      Parameters

      • chat: string

      Returns string | null

    • Pretty recap from a close() result.

      Parameters

      • closed:
            | {
                attendees: Attendee[];
                closedAt: number;
                openedAt: number;
                title: string;
            }
            | null

      Returns string | null

    • Serialize streaks + any open session for persistence.

      Returns Record<string, unknown>