From 735d4243c91e691babf5ef8468f6e5c4f9861b75 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Sat, 13 Apr 2024 10:40:36 +0000 Subject: [PATCH] docs: update documentation [skip ci] --- docs/classes/Client.html | 20 ++++---- docs/classes/ClientPlayer.html | 18 ++++---- docs/classes/ClientUser.html | 34 +++++++------- docs/classes/Game.html | 8 ++-- docs/classes/Player.html | 4 +- docs/classes/Room.html | 78 ++++++++++++++++---------------- docs/classes/User.html | 56 +++++++++++------------ docs/types/GameOptions.html | 2 +- docs/types/Member.html | 2 +- docs/variables/TetraChannel.html | 2 +- 10 files changed, 112 insertions(+), 112 deletions(-) diff --git a/docs/classes/Client.html b/docs/classes/Client.html index a9ea880..e96f1f9 100644 --- a/docs/classes/Client.html +++ b/docs/classes/Client.html @@ -1,5 +1,5 @@ Client | tetr.js

Class Client

Represents the client.

-

Hierarchy

  • EventEmitter
    • Client

Constructors

Hierarchy

  • EventEmitter
    • Client

Constructors

Properties

me? room token? @@ -36,9 +36,9 @@ once setMaxListeners

Constructors

  • Parameters

    • Optional options: EventEmitterOptions

    Returns Client

Properties

Details and actions that relate to the client's user.

-
room: Room = ...

Details about the current room.

-
token?: string

The client's token.

-
ws: default = ...
captureRejectionSymbol: typeof captureRejectionSymbol

Value: Symbol.for('nodejs.rejection')

+
room: Room = ...

Details about the current room.

+
token?: string

The client's token.

+
ws: default = ...
captureRejectionSymbol: typeof captureRejectionSymbol

Value: Symbol.for('nodejs.rejection')

See how to write a custom rejection handler.

Since

v13.4.0, v12.16.0

captureRejections: boolean

Value: boolean

@@ -88,7 +88,7 @@

Returns Promise<User>

A User object matching the provided details

Example

// '5f91f037630a88df78736f78':
(await client.fetchUser("proximitynow")).id;
-
  • Returns the current max listener value for the EventEmitter which is either +

  • Returns the current max listener value for the EventEmitter which is either set by emitter.setMaxListeners(n) or defaults to defaultMaxListeners.

    Returns number

    Since

    v1.0.0

  • Returns the number of listeners listening for the event named eventName. @@ -105,18 +105,18 @@

    Parameters

    • token: string

      The authentication token

    Returns Promise<void>

    Example

    await client.login(process.env.TOKEN);
     
    -
  • Login with a username/password combo.

    +
  • Login with a username/password combo.

    Parameters

    • username: string

      The username of the account

    • password: string

      The password of the account

    Returns Promise<void>

    Example

    await client.login_password(process.env.USERNAME, process.env.PASSWORD);
     

    Remarks

    A "user" account must not be used and a "bot" account is required. To obtain one, contact osk.

    -
  • Alias for emitter.removeListener().

    Parameters

    • eventName: string | symbol
    • listener: ((...args) => void)
        • (...args): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Client

    Since

    v10.0.0

  • Emitted when the client violates Ribbon's protocol.

    -

    Parameters

    • eventName: "nope"
    • listener: ((reason) => void)
        • (reason): void
        • Parameters

          • reason: string

          Returns void

    Returns Client

  • Emitted when the client gets kicked by the server.

    -

    Parameters

    • eventName: "kick"
    • listener: ((reason) => void)
        • (reason): void
        • Parameters

          • reason: string

          Returns void

    Returns Client

  • Emitted when a non fatal error occurs.

    -

    Parameters

    • eventName: "err"
    • listener: ((reason) => void)
        • (reason): void
        • Parameters

          • reason: string

          Returns void

    Returns Client

  • Adds a one-timelistener function for the event named eventName. The +

    Parameters

    • eventName: "nope"
    • listener: ((reason) => void)
        • (reason): void
        • Parameters

          • reason: string

          Returns void

    Returns Client

  • Emitted when the client gets kicked by the server.

    +

    Parameters

    • eventName: "kick"
    • listener: ((reason) => void)
        • (reason): void
        • Parameters

          • reason: string

          Returns void

    Returns Client

  • Emitted when a non fatal error occurs.

    +

    Parameters

    • eventName: "err"
    • listener: ((reason) => void)
        • (reason): void
        • Parameters

          • reason: string

          Returns void

    Returns Client

  • Adds a one-timelistener function for the event named eventName. The next time eventName is triggered, this listener is removed and then invoked.

    server.once('connection', (stream) => {
    console.log('Ah, we have our first user!');
    });
    diff --git a/docs/classes/ClientPlayer.html b/docs/classes/ClientPlayer.html index 2341379..851ca0f 100644 --- a/docs/classes/ClientPlayer.html +++ b/docs/classes/ClientPlayer.html @@ -1,4 +1,4 @@ -ClientPlayer | tetr.js

    Class ClientPlayer

    Hierarchy

    • EventEmitter
      • ClientPlayer

    Constructors

    constructor +ClientPlayer | tetr.js

    Class ClientPlayer

    Hierarchy

    • EventEmitter
      • ClientPlayer

    Constructors

    Properties

    Constructors

    Properties

    bag: string[] = ...
    bagQueue: string[][] = []
    currentBag?: string[] = []
    firstFrame: number = ...
    frameInterval?: Timeout
    frames: {
        data: any;
        type: string;
    }[]

    Type declaration

    • data: any
    • type: string
    holdPiece?: string
    lastGenerated?: number
    orientation: number = 0
    player: Player
    replayTimeout?: Timeout
    t: number = 0
    ws: default
    captureRejectionSymbol: typeof captureRejectionSymbol

    Value: Symbol.for('nodejs.rejection')

    +

    Constructors

    Properties

    bag: string[] = ...
    bagQueue: string[][] = []
    currentBag?: string[] = []
    firstFrame: number = ...
    frameInterval?: Timeout
    frames: {
        data: any;
        type: string;
    }[]

    Type declaration

    • data: any
    • type: string
    holdPiece?: string
    lastGenerated?: number
    orientation: number = 0
    player: Player
    replayTimeout?: Timeout
    t: number = 0
    ws: default
    captureRejectionSymbol: typeof captureRejectionSymbol

    Value: Symbol.for('nodejs.rejection')

    See how to write a custom rejection handler.

    Since

    v13.4.0, v12.16.0

    captureRejections: boolean

    Value: boolean

    @@ -91,7 +91,7 @@

    Installing a listener using this symbol does not change the behavior once an'error' event is emitted. Therefore, the process will still crash if no regular 'error' listener is installed.

    Since

    v13.6.0, v12.17.0

    -

    Accessors

    Methods

    • Parameters

      • error: Error
      • event: string
      • Rest ...args: any[]

      Returns void

    • Alias for emitter.on(eventName, listener).

      +

    Accessors

    Methods

    • Parameters

      • error: Error
      • event: string
      • Rest ...args: any[]

      Returns void

    • Alias for emitter.on(eventName, listener).

      Parameters

      • eventName: string | symbol
      • listener: ((...args) => void)
          • (...args): void
          • Parameters

            • Rest ...args: any[]

            Returns void

      Returns ClientPlayer

      Since

      v0.1.26

    • Synchronously calls each of the listeners registered for the event namedeventName, in the order they were registered, passing the supplied arguments to each.

      @@ -99,7 +99,7 @@
      import { EventEmitter } from 'node:events';
      const myEmitter = new EventEmitter();

      // First listener
      myEmitter.on('event', function firstListener() {
      console.log('Helloooo! first listener');
      });
      // Second listener
      myEmitter.on('event', function secondListener(arg1, arg2) {
      console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
      });
      // Third listener
      myEmitter.on('event', function thirdListener(...args) {
      const parameters = args.join(', ');
      console.log(`event with parameters ${parameters} in third listener`);
      });

      console.log(myEmitter.listeners('event'));

      myEmitter.emit('event', 1, 2, 3, 4, 5);

      // Prints:
      // [
      // [Function: firstListener],
      // [Function: secondListener],
      // [Function: thirdListener]
      // ]
      // Helloooo! first listener
      // event with parameters 1, 2 in second listener
      // event with parameters 1, 2, 3, 4, 5 in third listener

      Parameters

      • eventName: string | symbol
      • Rest ...args: any[]

      Returns boolean

      Since

      v0.1.26

      -
    • Returns an array listing the events for which the emitter has registered +

    • Returns an array listing the events for which the emitter has registered listeners. The values in the array are strings or Symbols.

      import { EventEmitter } from 'node:events';

      const myEE = new EventEmitter();
      myEE.on('foo', () => {});
      myEE.on('bar', () => {});

      const sym = Symbol('symbol');
      myEE.on(sym, () => {});

      console.log(myEE.eventNames());
      // Prints: [ 'foo', 'bar', Symbol(symbol) ]
      @@ -107,7 +107,7 @@
    • Returns the current max listener value for the EventEmitter which is either set by emitter.setMaxListeners(n) or defaults to defaultMaxListeners.

      Returns number

      Since

      v1.0.0

      -
    • Returns the number of listeners listening for the event named eventName. +

    • Returns the number of listeners listening for the event named eventName. If listener is provided, it will return how many times the listener is found in the list of the listeners of the event.

      Parameters

      • eventName: string | symbol

        The name of the event being listened for

        @@ -117,9 +117,9 @@
        server.on('connection', (stream) => {
        console.log('someone connected!');
        });
        console.log(util.inspect(server.listeners('connection')));
        // Prints: [ [Function] ]

        Parameters

        • eventName: string | symbol

        Returns Function[]

        Since

        v0.1.26

        -
    • Alias for emitter.removeListener().

      +
    • Alias for emitter.removeListener().

      Parameters

      • eventName: string | symbol
      • listener: ((...args) => void)
          • (...args): void
          • Parameters

            • Rest ...args: any[]

            Returns void

      Returns ClientPlayer

      Since

      v10.0.0

      -
    • Adds a one-timelistener function for the event named eventName. The +

    • Adds a one-timelistener function for the event named eventName. The next time eventName is triggered, this listener is removed and then invoked.

      server.once('connection', (stream) => {
      console.log('Ah, we have our first user!');
      });
      @@ -184,13 +184,13 @@

      Returns a reference to the EventEmitter, so that calls can be chained.

      Parameters

      • eventName: string | symbol
      • listener: ((...args) => void)
          • (...args): void
          • Parameters

            • Rest ...args: any[]

            Returns void

      Returns ClientPlayer

      Since

      v0.1.26

      -
    • By default EventEmitters will print a warning if more than 10 listeners are +

    • By default EventEmitters will print a warning if more than 10 listeners are added for a particular event. This is a useful default that helps finding memory leaks. The emitter.setMaxListeners() method allows the limit to be modified for this specific EventEmitter instance. The value can be set toInfinity (or 0) to indicate an unlimited number of listeners.

      Returns a reference to the EventEmitter, so that calls can be chained.

      Parameters

      • n: number

      Returns ClientPlayer

      Since

      v0.3.5

      -
    • Experimental

      Listens once to the abort event on the provided signal.

      +
    • Experimental

      Listens once to the abort event on the provided signal.

      Listening to the abort event on abort signals is unsafe and may lead to resource leaks since another third party with the signal can call e.stopImmediatePropagation(). Unfortunately Node.js cannot change diff --git a/docs/classes/ClientUser.html b/docs/classes/ClientUser.html index 19cabfa..e3fbd1c 100644 --- a/docs/classes/ClientUser.html +++ b/docs/classes/ClientUser.html @@ -1,5 +1,5 @@ ClientUser | tetr.js

      Class ClientUser

      Represents the Client's User.

      -

      Hierarchy

      • EventEmitter
        • ClientUser

      Constructors

      Hierarchy

      • EventEmitter
        • ClientUser

      Constructors

      Properties

      Constructors

      Properties

      banList: unknown[]

      unknown

      -
      bannedStatus: string

      unknown

      -
      email: string

      Registered email (if exists) for this account.

      -
      privacy: {
          dm: "nobody" | "friends" | "everyone";
          invite: "nobody" | "friends" | "everyone";
          privateMode: "private" | "public";
          showCountry: boolean;
          showGameTime: boolean;
          showPlayed: boolean;
          showWon: boolean;
          status: {
              deep: "nobody" | "friends" | "everyone";
              exact: "nobody" | "friends" | "everyone";
              shallow: "nobody" | "friends" | "everyone";
          };
      }

      Privacy settings for how other users may interact with this account.

      +

      Constructors

      Properties

      banList: unknown[]

      unknown

      +
      bannedStatus: string

      unknown

      +
      email: string

      Registered email (if exists) for this account.

      +
      privacy: {
          dm: "nobody" | "friends" | "everyone";
          invite: "nobody" | "friends" | "everyone";
          privateMode: "private" | "public";
          showCountry: boolean;
          showGameTime: boolean;
          showPlayed: boolean;
          showWon: boolean;
          status: {
              deep: "nobody" | "friends" | "everyone";
              exact: "nobody" | "friends" | "everyone";
              shallow: "nobody" | "friends" | "everyone";
          };
      }

      Privacy settings for how other users may interact with this account.

      Type declaration

      • dm: "nobody" | "friends" | "everyone"

        Determine who can send direct messages to this account.

      • invite: "nobody" | "friends" | "everyone"

        Determine who can send room invites to this account.

      • privateMode: "private" | "public"
      • showCountry: boolean

        Publicly display this account's country.

        @@ -54,20 +54,20 @@
        • deep: "nobody" | "friends" | "everyone"

          Determines who can what this account is doing.

        • exact: "nobody" | "friends" | "everyone"

          Determines who can see what room this account is in.

        • shallow: "nobody" | "friends" | "everyone"

          Determines who can see the online status of this account.

          -
      supporterExpires: number

      unknown

      -
      thanked: boolean

      unknown

      -
      totalSupported: number

      unknown

      -
      totp: {
          codesRemaining: number;
          enabled: boolean;
      }

      unknown

      +
supporterExpires: number

unknown

+
thanked: boolean

unknown

+
totalSupported: number

unknown

+
totp: {
    codesRemaining: number;
    enabled: boolean;
}

unknown

Type declaration

  • codesRemaining: number

    unknown

  • enabled: boolean

    unknown

    -
user: User

TetraChannel information regarding the client's user.

-
warnings: unknown[]

unknown

-
ws: default
zen: {
    level: number;
    map: string;
    progress: number;
    score: number;
}

Current zen mode progress.

+
user: User

TetraChannel information regarding the client's user.

+
warnings: unknown[]

unknown

+
ws: default
zen: {
    level: number;
    map: string;
    progress: number;
    score: number;
}

Current zen mode progress.

Type declaration

  • level: number

    Current zen level.

  • map: string

    unknown

  • progress: number

    Current progress through zen level

  • score: number

    Total score achieved in zen.

    -
captureRejectionSymbol: typeof captureRejectionSymbol

Value: Symbol.for('nodejs.rejection')

+
captureRejectionSymbol: typeof captureRejectionSymbol

Value: Symbol.for('nodejs.rejection')

See how to write a custom rejection handler.

Since

v13.4.0, v12.16.0

captureRejections: boolean

Value: boolean

@@ -128,9 +128,9 @@

Returns void

Example

client.me.presence({status: "online", detail: "zen"});
 

Remarks

Subject to privacy settings.

-
autoStart?: number

Countdown until the room start. (0 = to disable)

+
bgm?: string

Background song to play. If random, not everyone will hear the same song.

+
creator?: User

User object who created the room.

+
forceRequireXPToChat?: boolean

unknown

+
game?: Game

Gameplay events for this room

+
id?: string

The room ID.

+
match?: {
    extra: any;
    ft: number;
    gameMode: string;
    keys: any;
    modeName: string;
    recordReplays: boolean;
    wb: number;
    winningKey: string;
}

unknown

Type declaration

  • extra: any

    unknown

  • ft: number

    Amount of rounds one must win to win the game.

  • gameMode: string

    Game mode.

    @@ -82,19 +82,19 @@
  • recordReplays: boolean

    unknown

  • wb: number

    Amount of points one must have over the second place to secure the win.

  • winningKey: string

    unknown

    -
name?: string

Name this room will display in the listing as.

-
nameSafe?: string

unknown

-
options?: GameOptions

Information regarding gameplay settings.

-
owner?: User

User object of the current host.

-
players?: Map<string, Member>

The present players in the room.

-
state?: string

unknown

-
topic?: any

unknown

-
type?: "private" | "public"

Visibility status of the room.

-
useBestRankAsLimit?: boolean

If a rank limit is set, use the players' top ranks instead of their current ranks.

-
userLimit?: number

Maximum players in this room. (0 = no limit.)

+
name?: string

Name this room will display in the listing as.

+
nameSafe?: string

unknown

+
options?: GameOptions

Information regarding gameplay settings.

+
owner?: User

User object of the current host.

+
players?: Map<string, Member>

The present players in the room.

+
state?: string

unknown

+
topic?: any

unknown

+
type?: "private" | "public"

Visibility status of the room.

+
useBestRankAsLimit?: boolean

If a rank limit is set, use the players' top ranks instead of their current ranks.

+
userLimit?: number

Maximum players in this room. (0 = no limit.)

Remarks

Does not apply retroactively.

-
userRankLimit?: string

The maximum TETRA LEAGUE rank players may have to play in this room.

-
ws: default
captureRejectionSymbol: typeof captureRejectionSymbol

Value: Symbol.for('nodejs.rejection')

+
userRankLimit?: string

The maximum TETRA LEAGUE rank players may have to play in this room.

+
ws: default
captureRejectionSymbol: typeof captureRejectionSymbol

Value: Symbol.for('nodejs.rejection')

See how to write a custom rejection handler.

Since

v13.4.0, v12.16.0

captureRejections: boolean

Value: boolean

@@ -135,17 +135,17 @@

Example

// Change the player's bracket on command
client.room.on("chat", (message) => {
if (message.content === "!s")
return client.room.bracketSwitch("spectator", message.player);
})
-

Returns Promise<Room>

The room object of the joined room

Example

await client.room.join("FEFE");
 
-
  • Leave's the current room.

    -

    Returns Promise<void>

  • Returns the number of listeners listening for the event named eventName. +

  • Leave's the current room.

    +

    Returns Promise<void>

  • Returns the number of listeners listening for the event named eventName. If listener is provided, it will return how many times the listener is found in the list of the listeners of the event.

    Parameters

    • eventName: string | symbol

      The name of the event being listened for

      @@ -178,13 +178,13 @@

      Example

      // Change the player's bracket
       
  • Alias for emitter.removeListener().

    Parameters

    • eventName: string | symbol
    • listener: ((...args) => void)
        • (...args): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Room

    Since

    v10.0.0

  • Emitted when a player joins the room.

    -

    Parameters

    • eventName: "join"
    • listener: ((player) => void)
        • (player): void
        • Parameters

          Returns void

    Returns Room

  • Emitted when the the client gets kicked or banned from the room.

    -

    Parameters

    • eventName: "kick"
    • listener: ((type) => void)
        • (type): void
        • Parameters

          • type: string

          Returns void

    Returns Room

  • Emitted when a player sends a message.

    -

    Parameters

    • eventName: "chat"
    • listener: ((message) => void)
        • (message): void
        • Parameters

          • message: {
                author: Member;
                content: string;
            }

          Returns void

    Returns Room

  • Emitted when a player leaves the room.

    -

    Parameters

    • eventName: "leave"
    • listener: ((player) => void)
        • (player): void
        • Parameters

          Returns void

    Returns Room

  • Emitted when a player switches brackets.

    -

    Parameters

    • eventName: "bracket"
    • listener: ((player) => void)
        • (player): void
        • Parameters

          Returns void

    Returns Room

  • Emitted when the game starts.

    -

    Parameters

    • eventName: "start"
    • listener: ((game) => void)
        • (game): void
        • Parameters

          Returns void

    Returns Room

  • Emitted when the game ends.

    -

    Parameters

    • eventName: "end"
    • listener: ((leaderboard, victor) => void)
        • (leaderboard, victor): void
        • Parameters

          • leaderboard: Leaderboard[]
          • victor: Player

          Returns void

    Returns Room

  • Adds a one-timelistener function for the event named eventName. The +

    Parameters

    • eventName: "join"
    • listener: ((player) => void)
        • (player): void
        • Parameters

          Returns void

    Returns Room

  • Emitted when the the client gets kicked or banned from the room.

    +

    Parameters

    • eventName: "kick"
    • listener: ((type) => void)
        • (type): void
        • Parameters

          • type: string

          Returns void

    Returns Room

  • Emitted when a player sends a message.

    +

    Parameters

    • eventName: "chat"
    • listener: ((message) => void)
        • (message): void
        • Parameters

          • message: {
                author: Member;
                content: string;
            }

          Returns void

    Returns Room

  • Emitted when a player leaves the room.

    +

    Parameters

    • eventName: "leave"
    • listener: ((player) => void)
        • (player): void
        • Parameters

          Returns void

    Returns Room

  • Emitted when a player switches brackets.

    +

    Parameters

    • eventName: "bracket"
    • listener: ((player) => void)
        • (player): void
        • Parameters

          Returns void

    Returns Room

  • Emitted when the game starts.

    +

    Parameters

    • eventName: "start"
    • listener: ((game) => void)
        • (game): void
        • Parameters

          Returns void

    Returns Room

  • Emitted when the game ends.

    +

    Parameters

    • eventName: "end"
    • listener: ((leaderboard, victor) => void)
        • (leaderboard, victor): void
        • Parameters

          • leaderboard: Leaderboard[]
          • victor: Player

          Returns void

    Returns Room

  • Adds a one-timelistener function for the event named eventName. The next time eventName is triggered, this listener is removed and then invoked.

    server.once('connection', (stream) => {
    console.log('Ah, we have our first user!');
    });
    @@ -200,7 +200,7 @@

    Example

    // Change the player's bracket
     

    Parameters

    • player: Member

      The player to receive host

    Returns void

    Example

    // Receive host on bracket switch
    client.room.on("bracket", (player) => {
    if (player.user.id !== client.me.user.id)
    client.room.ownerTransfer(player);
    })
    -
  • Adds the listener function to the beginning of the listeners array for the +

  • Adds the listener function to the beginning of the listeners array for the event named eventName. No checks are made to see if the listener has already been added. Multiple calls passing the same combination of eventNameand listener will result in the listener being added, and called, multiple times.

    @@ -253,13 +253,13 @@

    Example

    // Change the player's bracket
     

    Returns a reference to the EventEmitter, so that calls can be chained.

    Parameters

    • eventName: string | symbol
    • listener: ((...args) => void)
        • (...args): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Room

    Since

    v0.1.26

    -
  • Parameters

    • config: Record<string, any> | {
          index: string;
          value: any;
      }[]

    Returns void

  • By default EventEmitters will print a warning if more than 10 listeners are +

  • Parameters

    • config: Record<string, any> | {
          index: string;
          value: any;
      }[]

    Returns void

  • By default EventEmitters will print a warning if more than 10 listeners are added for a particular event. This is a useful default that helps finding memory leaks. The emitter.setMaxListeners() method allows the limit to be modified for this specific EventEmitter instance. The value can be set toInfinity (or 0) to indicate an unlimited number of listeners.

    Returns a reference to the EventEmitter, so that calls can be chained.

    Parameters

    • n: number

    Returns Room

    Since

    v0.3.5

    -
  • Experimental

    Listens once to the abort event on the provided signal.

    +
  • Experimental

    Listens once to the abort event on the provided signal.

    Listening to the abort event on abort signals is unsafe and may lead to resource leaks since another third party with the signal can call e.stopImmediatePropagation(). Unfortunately Node.js cannot change diff --git a/docs/classes/User.html b/docs/classes/User.html index e5720eb..118c161 100644 --- a/docs/classes/User.html +++ b/docs/classes/User.html @@ -1,5 +1,5 @@ User | tetr.js

    Class User

    Represents a TetraChannel User.

    -

    Constructors

    Constructors

    Properties

    Methods

    Constructors

    Properties

    avatarRevision?: number

    This user's avatar ID.

    -
    badStanding?: boolean

    Whether this user current has a bad standing (recently banned).

    -
    badges: {
        id: string;
        label: string;
        ts?: Date;
    }[]

    The user's badges.

    +

    Constructors

    Properties

    avatarRevision?: number

    This user's avatar ID.

    +
    badStanding?: boolean

    Whether this user current has a bad standing (recently banned).

    +
    badges: {
        id: string;
        label: string;
        ts?: Date;
    }[]

    The user's badges.

    Type declaration

    • id: string

      The badge's internal ID, and the filename of the badge icon.

      Remarks

      All PNGs within /res/badges/.

    • label: string

      The badge's label, shown when hovered.

    • Optional ts?: Date

      The badge's timestamp, if shown.

      -
    bannerRevision?: number

    This user's banner ID.

    -
    bio?: string

    This user's "About Me" section.

    -
    botMaster?: string

    If this user is a bot, the bot's operator.

    -
    connections: {
        discord?: {
            id: string;
            username: string;
        };
    }

    This user's third party connections.

    +
bannerRevision?: number

This user's banner ID.

+
bio?: string

This user's "About Me" section.

+
botMaster?: string

If this user is a bot, the bot's operator.

+
connections: {
    discord?: {
        id: string;
        username: string;
    };
}

This user's third party connections.

Type declaration

  • Optional discord?: {
        id: string;
        username: string;
    }

    This user's connection to Discord.

    • id: string

      This user's Discord ID.

    • username: string

      This user's Discord Tag.

      -
country?: string

The user's ISO 3166-1 country code, or null if hidden/unknown. Some vanity flags exist.

-
distinguishment?: {
    type: string;
}

This user's distinguishment banner, if any.

+
country?: string

The user's ISO 3166-1 country code, or null if hidden/unknown. Some vanity flags exist.

+
distinguishment?: {
    type: string;
}

This user's distinguishment banner, if any.

Type declaration

  • type: string

    The type of distinguishment banner.

    -
friendCount: number

The amount of players who have added this user to their friends list.

-
gameTime: number

The amount of seconds this user spent playing, both on- and offline. If the user has chosen to hide this statistic, it will be -1.

-
gamesPlayed: number

The amount of online games played by this user. If the user has chosen to hide this statistic, it will be -1.

-
gamesWon: number

The amount of online games won by this user. If the user has chosen to hide this statistic, it wl be -1.

-
id: string

The user's internal ID.

-
league: {
    apm?: number;
    bestRank: string;
    decaying: boolean;
    gamesPlayed: number;
    gamesWon: number;
    glicko?: number;
    nextAt: number;
    nextRank?: string;
    percentile: number;
    percentileRank: string;
    pps?: number;
    prevAt: number;
    prevRank?: string;
    rank: string;
    rating: number;
    rd?: number;
    standing: number;
    standingLocal: number;
    vs?: number;
}

This user's current TETRA LEAGUE standing.

+
friendCount: number

The amount of players who have added this user to their friends list.

+
gameTime: number

The amount of seconds this user spent playing, both on- and offline. If the user has chosen to hide this statistic, it will be -1.

+
gamesPlayed: number

The amount of online games played by this user. If the user has chosen to hide this statistic, it will be -1.

+
gamesWon: number

The amount of online games won by this user. If the user has chosen to hide this statistic, it wl be -1.

+
id: string

The user's internal ID.

+
league: {
    apm?: number;
    bestRank: string;
    decaying: boolean;
    gamesPlayed: number;
    gamesWon: number;
    glicko?: number;
    nextAt: number;
    nextRank?: string;
    percentile: number;
    percentileRank: string;
    pps?: number;
    prevAt: number;
    prevRank?: string;
    rank: string;
    rating: number;
    rd?: number;
    standing: number;
    standingLocal: number;
    vs?: number;
}

This user's current TETRA LEAGUE standing.

Type declaration

  • Optional apm?: number

    This user's average APM (attack per minute) over the last 10 games.

  • bestRank: string

    This user's highest achieved rank this season.

  • decaying: boolean

    Whether this user's RD is rising (has not played in the last week).

    @@ -69,18 +69,18 @@
  • standing: number

    This user's position in global leaderboards, or -1 if not applicable.

  • standingLocal: number

    This user's position in local leaderboards, or -1 if not applicable.

  • Optional vs?: number

    This user's average VS (versus score) over the last 10 games.

    -
role: "anon" | "user" | "bot" | "halfmod" | "mod" | "admin" | "sysop"

The user's role.

-
supporter: boolean

Whether this user is currently supporting TETR.IO <3

-
supporterTier: number

An indicator of their total amount supported, between 0 and 4 inclusive.

-
ts?: Date

When the user account was created. If not set, this account was created before join dates were recorded.

-
username: string

The user's username.

-
verified: boolean

Whether this user is a verified account.

-
ws: default
xp: number

The user's XP in points.

-

Accessors

  • get avatarURL(): undefined | string
  • A link to the user's avatar if they have one.

    -

    Returns undefined | string

  • get bannerURL(): undefined | string
  • A link to the user's banner if they have one.

    -

    Returns undefined | string

Methods

  • Send a direct message to this user.

    +
role: "anon" | "user" | "bot" | "halfmod" | "mod" | "admin" | "sysop"

The user's role.

+
supporter: boolean

Whether this user is currently supporting TETR.IO <3

+
supporterTier: number

An indicator of their total amount supported, between 0 and 4 inclusive.

+
ts?: Date

When the user account was created. If not set, this account was created before join dates were recorded.

+
username: string

The user's username.

+
verified: boolean

Whether this user is a verified account.

+
ws: default
xp: number

The user's XP in points.

+

Accessors

  • get avatarURL(): undefined | string
  • A link to the user's avatar if they have one.

    +

    Returns undefined | string

  • get bannerURL(): undefined | string
  • A link to the user's banner if they have one.

    +

    Returns undefined | string

Methods

  • Send a direct message to this user.

    Parameters

    • msg: string

      The content of the message to send

    Returns void

    Example

    indonesia.send("Hello World!");
     
    -
  • Send an invite to the this user of the client's current room.

    -

    Returns void

Generated using TypeDoc

\ No newline at end of file +
  • Send an invite to the this user of the client's current room.

    +

    Returns void

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/GameOptions.html b/docs/types/GameOptions.html index 6c70dd0..fa4063d 100644 --- a/docs/types/GameOptions.html +++ b/docs/types/GameOptions.html @@ -78,4 +78,4 @@
  • stride: boolean

    unknown

  • version: number

    Protocol version.

  • zoomInto: string

    unknown

    -
  • Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/types/Member.html b/docs/types/Member.html index fdd4f3d..aa44eee 100644 --- a/docs/types/Member.html +++ b/docs/types/Member.html @@ -1,3 +1,3 @@ Member | tetr.js

    Type alias Member

    Member: {
        bracket: "spectator" | "player";
        user: User;
    }

    Type declaration

    • bracket: "spectator" | "player"

      The current bracket this member is in.

    • user: User

      The User object tied to this member.

      -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/variables/TetraChannel.html b/docs/variables/TetraChannel.html index 375b692..be4741f 100644 --- a/docs/variables/TetraChannel.html +++ b/docs/variables/TetraChannel.html @@ -20,4 +20,4 @@

    Returns Promise<UserRecordsType>

    Description

    An object describing the user in detail.

  • search: ((query) => Promise<UserSearchType | undefined>)
      • (query): Promise<UserSearchType | undefined>
      • Parameters

        • query: string

          The Discord ID (snowflake) to look up.

        Returns Promise<UserSearchType | undefined>

        Description

        An object describing the user found, or undefined if none found.

        -
  • Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file