From b643367862001bb700b8fc14a406ef401ee64222 Mon Sep 17 00:00:00 2001 From: DevAndromeda <46562212+DevAndromeda@users.noreply.github.com> Date: Thu, 21 Jul 2022 17:53:11 +0545 Subject: [PATCH] =?UTF-8?q?=F0=9F=86=95=20add=20createPlaylist=20method?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Player.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Player.ts b/src/Player.ts index 070ba53..1123526 100644 --- a/src/Player.ts +++ b/src/Player.ts @@ -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 { *[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 };