UNPKG

player-engine

Version:

Play your Musics in Your Discord Music Bot | Discord.js V13 Only

36 lines (35 loc) 1.59 kB
/// <reference types="node" /> import { Interaction, CommandInteraction, Guild, StageChannel, VoiceChannel } from "discord.js"; import { VoiceConnection } from "@discordjs/voice"; import { PlayerInterface, PlayerOptions, PlayerSearchOpts, RepeatMode, SupportedEngineClasses, SupportedEngines } from "../typings/Classes/Player"; import Queue from "./Queue"; import PlayerTrack from "../Structers/PlayerTrack"; import { EventEmitter } from "events"; export default class Player extends EventEmitter implements PlayerInterface { settings: PlayerOptions; readonly tracks: Queue; engine: SupportedEngineClasses; repeat: RepeatMode; private guild; private vcConnection; private channel; private audioPlayer; private vcSubscription; private isPlaying; private isConnected; private isDestroyed; constructor(guild: Guild, opts: PlayerOptions); private watchDestroyed; destroy(dc?: boolean): void; setEngine(engine: SupportedEngines): Player; setBitrate(a: number | "auto"): void; setVolume(a: number): boolean; setRepeatMode(mode: RepeatMode): boolean; isChannelEmpty(channel?: VoiceChannel | StageChannel): boolean; search(query: string, options?: PlayerSearchOpts): Promise<PlayerTrack | PlayerTrack[]>; connection(channel?: VoiceChannel | StageChannel): VoiceConnection | void; pause(interpolateSilence?: boolean): boolean; resume(): boolean; stop(unsubscribe?: boolean, forceStop?: boolean): boolean; play(tracks: PlayerTrack[], interaction: Interaction | CommandInteraction): Promise<void>; }