Class VoiceRegion

Represents a voice region with node ping tracking Used for latency-based node selection

Constructors

Properties

id: string
player: Player<QueueContext, []>

Accessors

Methods

  • Check if all ready nodes have ping data for this region

    Returns boolean

    true if all nodes are synced, false otherwise

  • Remove ping data for a node

    Parameters

    • name: string

      Node name

    Returns boolean

    true if data was removed, false if it didn't exist

  • Get the average ping for a node in this region

    Parameters

    • name: string

      Node name

    Returns null | number

    Average ping in milliseconds, or null if no data

  • Get all nodes with their average pings

    Returns [string, null | number][]

    Array of [nodeName, averagePing] tuples

  • Internal

    Internal method to update ping statistics Called by the voice manager when player state updates

    Parameters

    • name: string

      Node name

    • state: PlayerState

      Player state with ping information

    Returns void

  • JSON representation of the voice region

    Returns {
        id: string;
        inSync: boolean;
        nodeCount: number;
        pings: {
            node: string;
            averagePing: null | number;
            samples: number;
        }[];
    }

    • id: string
    • inSync: boolean
    • nodeCount: number
    • pings: {
          node: string;
          averagePing: null | number;
          samples: number;
      }[]