UNPKG

fuga

Version:

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

59 lines 2.05 kB
import { EventEmitter } from 'events'; import { RaftLinkNode } from './RaftLinkNode'; import { PlayerOptions, Track, VoiceServerUpdate, VoiceStateUpdate } from '../types'; import { Queue } from './Queue'; /** * Represents a music player for a specific guild. */ export declare class RaftLinkPlayer extends EventEmitter { readonly node: RaftLinkNode; readonly guildId: string; textChannelId: string | null; channelId: string | null; readonly queue: Queue; currentTrack: Track | null; playing: boolean; paused: boolean; volume: number; position: number; private voiceState; private voiceServer; constructor(node: RaftLinkNode, options: PlayerOptions); /** * Plays the next track in the queue. If a track is provided, it will be added to the queue first. * @param track An optional track to add to the queue before playing. */ play(track?: Track): Promise<void>; /** Stops the current track, clears the player, and disconnects. */ stop(): Promise<void>; /** * Pauses or resumes the player. * @param state True to pause, false to resume. Defaults to true. */ pause(state?: boolean): Promise<void>; /** * Seeks to a specific position in the current track. * @param position The position in milliseconds. */ seek(position: number): Promise<void>; /** * Sets the player's volume. * @param volume The volume, from 0 to 1000. */ setVolume(volume: number): Promise<void>; /** * Connects to a voice channel. * @param channelId The ID of the voice channel. */ connect(channelId: string, options?: { selfDeaf?: boolean; selfMute?: boolean; }): this; /** Disconnects from the voice channel. */ disconnect(): void; /** Disconnects from the voice channel and destroys the player instance. */ destroy(): void; /** @internal */ handleVoiceUpdate(payload: VoiceStateUpdate | VoiceServerUpdate): void; } //# sourceMappingURL=RaftLinkPlayer.d.ts.map