Skip to content

Playlist

Class representing a playlist.

T = unknown

new Playlist<T>(playlist, options?): Playlist<T>;

Create a Playlist

PlaylistInfo

Raw playlist info

ResolveOptions<T> = {}

Optional data

Playlist<T>

DisTubeError When the playlist does not have any song

id?: string;

Playlist ID.

PlaylistInfo.id


name?: string;

Playlist name.

PlaylistInfo.name


songs: Song<unknown>[];

Songs in the playlist.

PlaylistInfo.songs


source: string;

Playlist source.

PlaylistInfo.source


thumbnail?: string;

Playlist thumbnail.

PlaylistInfo.thumbnail


url?: string;

Playlist URL.

PlaylistInfo.url

get duration(): number;

Playlist duration in second.

number


get formattedDuration(): string;

Formatted duration string hh:mm:ss.

string


get member(): GuildMember | undefined;

User requested.

GuildMember | undefined

set member(member): void;

Set the user that requested the playlist.

The value is ignored when it is not a valid guild member.

GuildMember | undefined

The member

void


get metadata(): T;

Optional metadata that can be used to identify the playlist.

T

set metadata(metadata): void;

Set the metadata of the playlist.

The metadata of the songs is not changed when the metadata is undefined.

T

The metadata

void


get user(): User | undefined;

User requested.

User | undefined

toString(): string;

The name of the playlist and the number of its songs.

string

The string representation of the playlist