kazagumo
Version:
A shoukaku wrapper with built-in queue support.
151 lines (150 loc) • 4.02 kB
TypeScript
import { Kazagumo } from '../Kazagumo';
import { KazagumoQueue } from './Supports/KazagumoQueue';
import { FilterOptions, Player } from 'shoukaku';
import { KazagumoPlayerOptions, KazagumoSearchOptions, KazagumoSearchResult, PlayerState, PlayOptions } from '../Modules/Interfaces';
import { KazagumoTrack } from './Supports/KazagumoTrack';
export declare class KazagumoPlayer {
private readonly customData;
/**
* Kazagumo options
*/
private options;
/**
* Kazagumo Instance
*/
readonly kazagumo: Kazagumo;
/**
* Shoukaku's Player instance
*/
shoukaku: Player;
/**
* The guild ID of the player
*/
readonly guildId: string;
/**
* The voice channel ID of the player
*/
voiceId: string | null;
/**
* The text channel ID of the player
*/
textId?: string;
/**
* Player's queue
*/
readonly queue: KazagumoQueue;
/**
* Get the current state of the player
*/
state: PlayerState;
/**
* Paused state of the player
*/
paused: boolean;
/**
* Whether the player is playing or not
*/
playing: boolean;
/**
* Loop status
*/
loop: 'none' | 'queue' | 'track';
/**
* Search track/s
*/
search: (query: string, options?: KazagumoSearchOptions) => Promise<KazagumoSearchResult>;
/**
* Player's volume in percentage (default 100%)
*/
volume: number;
/**
* Player's custom data
*/
readonly data: Map<string, any>;
/**
* Initialize the player
* @param kazagumo Kazagumo instance
* @param player Shoukaku's Player instance
* @param options Kazagumo options
* @param customData private readonly customData
*/
constructor(kazagumo: Kazagumo, player: Player, options: KazagumoPlayerOptions, customData: unknown);
/**
* Get player position
*/
get position(): number;
/**
* Get filters
*/
get filters(): FilterOptions;
private get node();
/**
* Pause the player
* @param pause Whether to pause or not
* @returns KazagumoPlayer
*/
pause(pause: boolean): KazagumoPlayer;
/**
* Set text channel
* @param textId Text channel ID
* @returns KazagumoPlayer
*/
setTextChannel(textId: string): KazagumoPlayer;
/**
* Set voice channel and move the player to the voice channel
* @param voiceId Voice channel ID
* @returns KazagumoPlayer
*/
setVoiceChannel(voiceId: string): KazagumoPlayer;
/**
* Get the previous track from the queue
* @param remove Whether to remove the track from the previous list or not. Best to set to true if you want to play it
*/
getPrevious(remove?: boolean): KazagumoTrack | undefined;
/**
* Set loop mode
* @param [loop] Loop mode
* @returns KazagumoPlayer
*/
setLoop(loop?: 'none' | 'queue' | 'track'): KazagumoPlayer;
/**
* Play a track
* @param track Track to play
* @param options Play options
* @returns KazagumoPlayer
*/
play(track?: KazagumoTrack, options?: PlayOptions): Promise<KazagumoPlayer>;
/**
* Skip the current track
* @returns KazagumoPlayer
*/
skip(): KazagumoPlayer;
/**
* Seek to a position
* @param position Position in seconds
* @returns KazagumoPlayer
*/
seek(position: number): Promise<KazagumoPlayer>;
/**
* Set the volume in percentage (default 100%)
* @param volume Volume
* @returns KazagumoPlayer
*/
setVolume(volume: number): Promise<KazagumoPlayer>;
/**
* Connect to the voice channel
* @returns KazagumoPlayer
*/
connect(): KazagumoPlayer;
/**
* Disconnect from the voice channel
* @returns KazagumoPlayer
*/
disconnect(): KazagumoPlayer;
/**
* Destroy the player
* @returns KazagumoPlayer
*/
destroy(): Promise<KazagumoPlayer>;
private emit;
}