DisTubeOptions
type DisTubeOptions = object;DisTube options
Properties
Section titled “Properties”autoplayAttempts?
Section titled “autoplayAttempts?”autoplayAttempts?: number;The number of times in a row that autoplay items may fail to prepare or stream before autoplay gives up. When an attempt fails, another related song from the same seed is queried.
Default
Section titled “Default”3crossfade?
Section titled “crossfade?”crossfade?: object;Crossfade the end of the current song with the beginning of the next one, instead of a hard switch between two streams.
The transition is a single FFmpeg process that mixes both songs with an
acrossfade filter, so the fade is seamless (no gaps, no extra decode
round-trips). Because the fade length must be prepared in advance, the
next song’s stream is resolved even when preloading is disabled.
Can be an object to configure it:
duration: the default crossfade duration in seconds for new queues (@default 0). Each Queue can override it at runtime with itscrossfadeproperty, which is what bots typically bind to a guild setting.curve: the FFmpegacrossfadefade curve (@default “qsin”)warmup: seconds before the fade window when the transition stream is spawned to warm up its buffers (@default 5)preparePrimaryInput: an optional adapter preparing the fading-out song’s FFmpeg input before the transition stream is spawned. Useful for streaming inputs that cannot fast-seek (CrossfadeOptions.preparePrimaryInput).
curve?
Section titled “curve?”curve?: string;The FFmpeg acrossfade fade curve applied to both songs.
duration?
Section titled “duration?”duration?: number;The default crossfade duration (in seconds) for new queues (0 disables).
preparePrimaryInput?
Section titled “preparePrimaryInput?”preparePrimaryInput?: PrepareCrossfadeInput;Optional adapter preparing the fading-out song’s FFmpeg input (CrossfadeOptions.preparePrimaryInput).
warmup?
Section titled “warmup?”warmup?: number;Seconds before the fade window when the transition stream is spawned.
Default
Section titled “Default”{ duration: 0, curve: "qsin", warmup: 5 }customFilters?
Section titled “customFilters?”customFilters?: Filters;Override defaultFilters or add more ffmpeg filters
emitAddListWhenCreatingQueue?
Section titled “emitAddListWhenCreatingQueue?”emitAddListWhenCreatingQueue?: boolean;Whether or not emitting addList event when creating a new Queue
Default
Section titled “Default”trueemitAddSongWhenCreatingQueue?
Section titled “emitAddSongWhenCreatingQueue?”emitAddSongWhenCreatingQueue?: boolean;Whether or not emitting addSong event when creating a new Queue
Default
Section titled “Default”trueemitNewSongOnly?
Section titled “emitNewSongOnly?”emitNewSongOnly?: boolean;Whether or not emitting Events.PLAY_SONG event when looping a song or next song is the same as the previous one
Default
Section titled “Default”falseffmpeg?
Section titled “ffmpeg?”ffmpeg?: object;FFmpeg options
args?: Partial<FFmpegArgs>;FFmpeg default arguments
path?: string;FFmpeg path
joinNewVoiceChannel?
Section titled “joinNewVoiceChannel?”joinNewVoiceChannel?: boolean;Whether or not joining the new voice channel when using DisTube#play method
Default
Section titled “Default”truensfw?: boolean;Whether or not playing age-restricted content and disabling safe search in non-NSFW channel
Default
Section titled “Default”falseplugins?
Section titled “plugins?”plugins?: DisTubePlugin[];DisTube plugins. The order of this effects the priority of the plugins when verifying the input.
preload?
Section titled “preload?”preload?: | boolean | { enabled?: boolean; threshold?: number;};Pre-fetch stream information and prepare the stream for the next song in the queue before the current song finishes playing, to reduce the delay between two songs.
Can be a simple boolean to toggle it with the default threshold, or an
object to configure it:
enabled: whether or not preloading is enabled (@default false)threshold: the number of seconds remaining in the currently playing song before preloading starts (@default 15)
Union Members
Section titled “Union Members”boolean
Type Literal
Section titled “Type Literal”{ enabled?: boolean; threshold?: number;}enabled?
Section titled “enabled?”enabled?: boolean;Whether or not preloading is enabled.
threshold?
Section titled “threshold?”threshold?: number;The number of seconds remaining in the currently playing song before preloading starts.
Default
Section titled “Default”falsesavePreviousSongs?
Section titled “savePreviousSongs?”savePreviousSongs?: boolean;Whether or not saving the previous songs of the queue and enable Queue#previous method. Disable it may help to reduce the memory usage
Default
Section titled “Default”truestuckThreshold?
Section titled “stuckThreshold?”stuckThreshold?: number;Time (in milliseconds) a track may stay in the “buffering” state before it is considered stuck and gets skipped automatically.
Set to 0 to disable the stuck-track detection.
Default
Section titled “Default”10000unhandledError?
Section titled “unhandledError?”unhandledError?: UnhandledErrorBehavior;Behavior when the Events.ERROR event is emitted but nobody listens to it.
By default ("log"), the error is logged to the console instead of crashing the
process, which is the Node.js default behavior for the special "error" event.
Default
Section titled “Default”"log"