Playlist
Class representing a playlist.
Type Parameters
Section titled “Type Parameters”T = unknown
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Playlist<T>(playlist, options?): Playlist<T>;Create a Playlist
Parameters
Section titled “Parameters”playlist
Section titled “playlist”Raw playlist info
options?
Section titled “options?”ResolveOptions<T> = {}
Optional data
Returns
Section titled “Returns”Playlist<T>
Throws
Section titled “Throws”DisTubeError When the playlist does not have any song
Properties
Section titled “Properties”id?: string;Playlist ID.
Implementation of
Section titled “Implementation of”name?: string;Playlist name.
Implementation of
Section titled “Implementation of”songs: Song<unknown>[];Songs in the playlist.
Implementation of
Section titled “Implementation of”source
Section titled “source”source: string;Playlist source.
Implementation of
Section titled “Implementation of”thumbnail?
Section titled “thumbnail?”thumbnail?: string;Playlist thumbnail.
Implementation of
Section titled “Implementation of”url?: string;Playlist URL.
Implementation of
Section titled “Implementation of”Accessors
Section titled “Accessors”duration
Section titled “duration”Get Signature
Section titled “Get Signature”get duration(): number;Playlist duration in second.
Returns
Section titled “Returns”number
formattedDuration
Section titled “formattedDuration”Get Signature
Section titled “Get Signature”get formattedDuration(): string;Formatted duration string hh:mm:ss.
Returns
Section titled “Returns”string
member
Section titled “member”Get Signature
Section titled “Get Signature”get member(): GuildMember | undefined;User requested.
Returns
Section titled “Returns”GuildMember | undefined
Set Signature
Section titled “Set Signature”set member(member): void;Set the user that requested the playlist.
The value is ignored when it is not a valid guild member.
Parameters
Section titled “Parameters”member
Section titled “member”GuildMember | undefined
The member
Returns
Section titled “Returns”void
metadata
Section titled “metadata”Get Signature
Section titled “Get Signature”get metadata(): T;Optional metadata that can be used to identify the playlist.
Returns
Section titled “Returns”T
Set Signature
Section titled “Set Signature”set metadata(metadata): void;Set the metadata of the playlist.
The metadata of the songs is not changed when the metadata is undefined.
Parameters
Section titled “Parameters”metadata
Section titled “metadata”T
The metadata
Returns
Section titled “Returns”void
Get Signature
Section titled “Get Signature”get user(): User | undefined;User requested.
Returns
Section titled “Returns”User | undefined
Methods
Section titled “Methods”toString()
Section titled “toString()”toString(): string;The name of the playlist and the number of its songs.
Returns
Section titled “Returns”string
The string representation of the playlist