🆕 add createPlaylist method

This commit is contained in:
DevAndromeda 2022-07-21 17:53:11 +05:45
parent 211d62d24a
commit b643367862

View file

@ -2,7 +2,7 @@ import { Client, Collection, GuildResolvable, Snowflake, User, VoiceState, Inten
import { TypedEmitter as EventEmitter } from "tiny-typed-emitter";
import { Queue } from "./Structures/Queue";
import { VoiceUtils } from "./VoiceInterface/VoiceUtils";
import { PlayerEvents, PlayerOptions, QueryType, SearchOptions, PlayerInitOptions, PlayerSearchResult } from "./types/types";
import { PlayerEvents, PlayerOptions, QueryType, SearchOptions, PlayerInitOptions, PlayerSearchResult, PlaylistInitData } from "./types/types";
import Track from "./Structures/Track";
import { QueryResolver } from "./utils/QueryResolver";
import YouTube from "youtube-sr";
@ -596,6 +596,14 @@ class Player extends EventEmitter<PlayerEvents> {
*[Symbol.iterator]() {
yield* Array.from(this.queues.values());
}
/**
* Creates `Playlist` instance
* @param data The data to initialize a playlist
*/
createPlaylist(data: PlaylistInitData) {
return new Playlist(this, data);
}
}
export { Player };