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

    Interface RPS

    interface RPS {
        normalizeChoice: (input: string) => RpsChoice | null;
        size: number;
        accept(chat: string, user: string): boolean;
        cancel(chat: string): boolean;
        challenge(
            chat: string,
            challenger: string,
            opponent: string,
            options?: { bet?: number; rounds?: number },
        ): { bet: number; challenger: string; chat: string; opponent: string };
        getDuel(
            chat: string,
        ):
            | {
                a: string;
                b: string;
                bet: number;
                pendingAccept: boolean;
                picked: string[];
                round: number;
                rounds: number;
                score: Record<string, number>;
            }
            | null;
        getStats(
            user: string,
        ): { losses: number; user: string; wins: number } | null;
        isActive(chat: string): boolean;
        onResult(cb: (result: RpsResult) => void): () => void;
        pick(chat: string, user: string, choice: string): string | RpsResult;
        renderSeries(chat: string): string | null;
    }
    Index
    normalizeChoice: (input: string) => RpsChoice | null

    Type Declaration

      • (input: string): RpsChoice | null
      • Normalize aliases/emoji (batu/gunting/kertas, ✊✋✌️) or null.

        Parameters

        • input: string

        Returns RpsChoice | null

    size: number
    • Parameters

      • chat: string
      • user: string

      Returns boolean

    • Parameters

      • chat: string
      • challenger: string
      • opponent: string
      • Optionaloptions: { bet?: number; rounds?: number }

      Returns { bet: number; challenger: string; chat: string; opponent: string }

    • Reveals WHO picked, never WHAT.

      Parameters

      • chat: string

      Returns
          | {
              a: string;
              b: string;
              bet: number;
              pendingAccept: boolean;
              picked: string[];
              round: number;
              rounds: number;
              score: Record<string, number>;
          }
          | null

    • Lifetime series record, or null.

      Parameters

      • user: string

      Returns { losses: number; user: string; wins: number } | null

    • Parameters

      • chat: string

      Returns boolean

    • 'waiting' | RpsResult | 'no-duel' | 'not-accepted' | 'not-a-player' | 'bad-choice' | 'already-picked'

      Parameters

      • chat: string
      • user: string
      • choice: string

      Returns string | RpsResult

    • Live series scoreboard, or null.

      Parameters

      • chat: string

      Returns string | null