FAQ
The library
Section titled “The library”FFMPEG_NOT_INSTALLED
Section titled “FFMPEG_NOT_INSTALLED”FFmpeg is not installed, or it is not in your PATH.
# Linuxsudo apt-get install ffmpeg# macOSbrew install ffmpeg# Windowswinget install Gyan.FFmpegIf it is installed but somewhere else, point the library at it:
const distube = new DisTube(client, { ffmpeg: { path: "/usr/local/bin/ffmpeg" },});The track ends instantly, or write EPIPE
Section titled “The track ends instantly, or write EPIPE”This is an FFmpeg error. The ffmpegDebug event shows the exact command line and the log of the
process.
distube.on(Events.FFMPEG_DEBUG, console.log);Cannot find module '@discordjs/opus'
Section titled “Cannot find module '@discordjs/opus'”The Opus encoder is missing.
bun add @discordjs/opusRangeError: Source is too large
Section titled “RangeError: Source is too large”node-opus and opusscript are unstable. Remove them, and install @discordjs/opus instead.
bun remove opusscript node-opusbun add @discordjs/opusVOICE_CONNECTION_TIMEOUT
Section titled “VOICE_CONNECTION_TIMEOUT”The bot cannot reach the voice servers. It is usually the network of the host, not the code.
Try to join the channel before the first track:
await distube.voices.join(voiceChannel);Cannot connect to the voice channel after 30 seconds
Section titled “Cannot connect to the voice channel after 30 seconds”Discord requires the DAVE end-to-end encryption since March 2026. Install @discordjs/voice 0.19.1
or later; DisTube enables DAVE on every connection. An older voice package cannot join a voice
channel, even when a transport encryption library is installed.
The bot plays a random track when the queue is empty
Section titled “The bot plays a random track when the queue is empty”The autoplay is on. Turn it off for a guild:
distube.on(Events.INIT_QUEUE, (queue) => { queue.autoplay = false;});The bot is stuck in a silence
Section titled “The bot is stuck in a silence”A track that does not produce any audio is detected and skipped after ten seconds. Raise the limit
with the stuckThreshold option:
const distube = new DisTube(client, { stuckThreshold: 20_000,});Set it to 0 to turn the detection off.
The plugins
Section titled “The plugins”The source asks for a signed-in session
Section titled “The source asks for a signed-in session”Some services answer a request that comes from a bot with a challenge, a rate limit, or a refusal. A plugin that talks to such a service usually takes a session cookie or a token. The plugin documents what it expects, and the symptom is a request that fails with a challenge or with a rate limit. See source sessions.
The session expired
Section titled “The session expired”A session expires, and the plugin cannot authenticate any more. Export a new one and give it to the plugin.
The plugin does not find the track
Section titled “The plugin does not find the track”Check the order of the plugins: the first one whose validate() returns true for a URL is the one
used to resolve it. Give a URL to the plugin you want, or use the source option:
await distube.search("faded", { source: "my-source" });The commands
Section titled “The commands”How do I use slash commands?
Section titled “How do I use slash commands?”DisTube works with any command handler. A chat input command is in Discord.js events.
Why are the shortcut methods gone?
Section titled “Why are the shortcut methods gone?”They were deprecated in v5.2 and removed in v6. They hid the queue, which made the code harder to
read and to type. Use distube.getQueue(guildId).method() instead. See
upgrading.
The library itself
Section titled “The library itself”How do I report a bug?
Section titled “How do I report a bug?”Open an issue on GitHub, with:
- the version of DisTube, of discord.js and of Node.js
- the plugin you use, and its version
- the
ffmpegDebugoutput of a failing track - the code that reproduces the problem
Where do I ask a question?
Section titled “Where do I ask a question?”On the Discord server.