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

    Interface WordFilter

    interface WordFilter {
        autoDelete: boolean;
        size: number;
        stats: { deleted: number; matches: number };
        addChatWords(chat: string, ...words: (string | string[])[]): void;
        addPatterns(...patterns: (RegExp | RegExp[])[]): void;
        addWords(...words: (string | string[])[]): void;
        allow(...chats: (string | string[])[]): number;
        bind(sock: unknown): () => void;
        getAllowlist(): string[];
        getCensored(text: string, options?: { char?: string }): string;
        getChatWords(chat: string): string[];
        getWords(): string[];
        handler(upsert: { messages: unknown[] }, sock?: unknown): Promise<void>;
        isAllowed(chat: string): boolean;
        onError(cb: (info: { error: unknown; msg: unknown }) => void): () => void;
        onMatch(cb: (match: WordFilterMatch) => void): () => void;
        removeChatWords(chat: string, ...words: (string | string[])[]): void;
        removeWords(...words: (string | string[])[]): void;
        setAutoDelete(on: boolean): boolean;
        test(text: string): string | null;
        unallow(...chats: (string | string[])[]): number;
        unbind(): void;
    }
    Index
    autoDelete: boolean

    Whether auto-delete is currently enabled.

    size: number
    stats: { deleted: number; matches: number }

    Running counters since creation.

    • Chat-specific banned words (on top of the global list).

      Parameters

      • chat: string
      • ...words: (string | string[])[]

      Returns void

    • Parameters

      • ...patterns: (RegExp | RegExp[])[]

      Returns void

    • Parameters

      • ...words: (string | string[])[]

      Returns void

    • Add exempt chat jid(s) to the allowlist at runtime. Returns the new allowlist size.

      Parameters

      • ...chats: (string | string[])[]

      Returns number

    • Star out every configured word in a text.

      Parameters

      • text: string
      • Optionaloptions: { char?: string }

      Returns string

    • Parameters

      • upsert: { messages: unknown[] }
      • Optionalsock: unknown

      Returns Promise<void>

    • Is this chat currently exempt from filtering?

      Parameters

      • chat: string

      Returns boolean

    • Parameters

      • cb: (info: { error: unknown; msg: unknown }) => void

      Returns () => void

    • Parameters

      • chat: string
      • ...words: (string | string[])[]

      Returns void

    • Parameters

      • ...words: (string | string[])[]

      Returns void

    • Toggle delete-for-everyone on matches at runtime. Returns the new state.

      Parameters

      • on: boolean

      Returns boolean

    • Check a text directly; returns the matched fragment or null.

      Parameters

      • text: string

      Returns string | null

    • Remove chat jid(s) from the allowlist at runtime. Returns the new allowlist size.

      Parameters

      • ...chats: (string | string[])[]

      Returns number