Skip to content

Options

The validated options of a DisTube instance.

Every option has a default value, and every option is validated when the instance is created.

new Options(options): Options;

Create the options of a DisTube instance.

DisTubeOptions

The options given by the user

Options

DisTubeError When an option has an invalid type, or when it is not a known option

autoplayAttempts: number;

The number of times in a row that autoplay items may fail before autoplay gives up.

3

crossfade: CrossfadeOptions;

The crossfade options of the DisTube instance.

{ duration: 0, curve: "qsin", warmup: 5 }

customFilters?: Filters;

The custom FFmpeg audio filters, that override the defaultFilters.


emitAddListWhenCreatingQueue: boolean;

Whether or not the Events.ADD_LIST event is emitted when a new Queue is created.

true

emitAddSongWhenCreatingQueue: boolean;

Whether or not the Events.ADD_SONG event is emitted when a new Queue is created.

true

emitNewSongOnly: boolean;

Whether or not the Events.PLAY_SONG event is emitted when looping a song or when the next song is the same as the previous one.

false

ffmpeg: FFmpegOptions;

The FFmpeg options of the DisTube instance.


joinNewVoiceChannel: boolean;

Whether or not the bot joins the new voice channel when DisTube#play is used.

true

nsfw: boolean;

Whether or not age-restricted content can be played in a non-NSFW channel.

false

plugins: DisTubePlugin[];

The plugins of the DisTube instance.


preload: PreloadOptions;

The preload options of the DisTube instance.

{ enabled: false, threshold: 15 }

savePreviousSongs: boolean;

Whether or not the previous songs of a Queue are saved.

true

stuckThreshold: number;

The time (in milliseconds) a track may stay in the “buffering” state before it is considered stuck and gets skipped.

Set to 0 to disable the stuck-track detection.

10000

unhandledError: UnhandledErrorBehavior;

The behavior of the Events.ERROR event when it has no listener.

"log"