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

    Interface GroupOpGuard

    interface GroupOpGuard {
        assert(op: string, count?: number): GroupOpCheck;
        check(op: string, count?: number): GroupOpCheck;
        configure(
            op: string,
            limit: Partial<{ max: number; windowMs: number }>,
        ): void;
        getUsage(): Record<string, { max: number; used: number }>;
        load(snapshot: { history?: [string, number[]][] }): void;
        onBlocked(cb: (info: { op: string } & GroupOpCheck) => void): () => void;
        record(op: string, count?: number): void;
        reset(): void;
        toJSON(): { history: [string, number[]][] };
        waitAndAssert(
            op: string,
            count?: number,
            options?: { maxWaitMs?: number },
        ): Promise<GroupOpCheck>;
        wrap<T>(sock: T): T;
    }
    Index
    • Change an operation's limit at runtime.

      Parameters

      • op: string
      • limit: Partial<{ max: number; windowMs: number }>

      Returns void

    • Restore a toJSON() snapshot of the rate-limit history.

      Parameters

      • snapshot: { history?: [string, number[]][] }

      Returns void

    • Serialize the rate-limit history so it survives a restart.

      Returns { history: [string, number[]][] }

    • Wait until allowed, then record (throws past maxWaitMs).

      Parameters

      • op: string
      • Optionalcount: number
      • Optionaloptions: { maxWaitMs?: number }

      Returns Promise<GroupOpCheck>