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

    Interface Router

    interface Router {
        attach(sock: any): () => void;
        command(
            names: string | string[],
            handler: (ctx: RouterContext) => any,
            opts?: RouterCommandOptions,
        ): Router;
        handle(sock: any, webMessage: any): Promise<boolean>;
        list(): {
            adminOnly: boolean;
            category: string;
            cooldownMs: number;
            desc: string;
            dmOnly: boolean;
            groupOnly: boolean;
            hidden: boolean;
            names: string[];
            ownerOnly: boolean;
        }[];
        remove(name: string): boolean;
        use(mw: (ctx: RouterContext, next: () => Promise<void>) => any): Router;
    }
    Index
    • Parameters

      • sock: any
      • webMessage: any

      Returns Promise<boolean>

    • Returns {
          adminOnly: boolean;
          category: string;
          cooldownMs: number;
          desc: string;
          dmOnly: boolean;
          groupOnly: boolean;
          hidden: boolean;
          names: string[];
          ownerOnly: boolean;
      }[]

    • Unregister a command and all its aliases.

      Parameters

      • name: string

      Returns boolean