UNPKG

fuga

Version:

A comprehensive, feature-rich, and modern Lavalink v4 client for Node.js

43 lines 1.72 kB
import { EventEmitter } from 'events'; import { RaftLinkNode } from './RaftLinkNode'; import { RaftLinkPlayer } from './RaftLinkPlayer'; import { ManagerOptions, NodeOptions, PlayerOptions, VoiceServerUpdate, VoiceStateUpdate, LoadTracksResult, SourceType } from '../types'; /** * The main hub for RaftLink, manages all nodes and players. */ export declare class RaftLinkManager extends EventEmitter { readonly nodes: Map<string, RaftLinkNode>; readonly players: Map<string, RaftLinkPlayer>; userId: string | null; private nodesToAdd; private readonly send; constructor(options: ManagerOptions); init(userId: string): void; private addNodes; /** * Adds a new Lavalink node to the manager. * @param options The options for the node. */ addNode(options: NodeOptions): RaftLinkNode; /** * Creates a new player or returns an existing one. * @param options The options for creating a player. */ createPlayer(options: PlayerOptions): RaftLinkPlayer; /** * Forwards voice updates from your Discord library to the relevant player. * @param payload The raw voice state or server update payload. */ handleVoiceUpdate(payload: VoiceStateUpdate | VoiceServerUpdate): void; /** * Searches for tracks using the best available node. * @param query The search query or URL. */ search(query: string, requester: any, source?: SourceType): Promise<LoadTracksResult>; /** * Gets the most ideal node for new players based on player count and CPU load. * @returns The best available RaftLinkNode. */ getIdealNode(): RaftLinkNode | undefined; } //# sourceMappingURL=RaftLinkManager.d.ts.map