Skip to main content
Version: v2.10.3

Track

uri, artworkUrl, and isrc can be null. Check them before string operations or building links. Lavalink userData is exposed on built tracks as customData.

Definition​

export interface Track {
/** The base64 encoded track. */
readonly track: string;
/** The artwork url of the track. */
readonly artworkUrl: string | null;
/** The track source name. */
readonly sourceName: TrackSourceName;
/** The title of the track. */
title: string;
/** The identifier of the track. */
readonly identifier: string;
/** The author of the track. */
author: string;
/** The duration of the track. */
readonly duration: number;
/** The ISRC of the track. */
readonly isrc: string | null;
/** If the track is seekable. */
readonly isSeekable: boolean;
/** If the track is a stream.. */
readonly isStream: boolean;
/** The uri of the track. */
readonly uri: string | null;
/** The thumbnail of the track or null if it's a unsupported source. */
readonly thumbnail: string | null;
/** The user that requested the track. */
requester: AnyUser;
/** Displays the track thumbnail with optional size or null if it's a unsupported source. */
displayThumbnail(size?: Sizes): string | null;
/** Additional track info provided by plugins. */
pluginInfo: TrackPluginInfo;
/** Add your own data to the track. */
customData: Record<string, unknown>;
/** If the track got added by autoplay. */
readonly isAutoplay: boolean;
}