Skip to content

FAQ

FFmpeg is not installed, or it is not in your PATH.

Terminal window
# Linux
sudo apt-get install ffmpeg
# macOS
brew install ffmpeg
# Windows
winget install Gyan.FFmpeg

If it is installed but somewhere else, point the library at it:

const distube = new DisTube(client, {
ffmpeg: { path: "/usr/local/bin/ffmpeg" },
});

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);

The Opus encoder is missing.

Terminal window
bun add @discordjs/opus

node-opus and opusscript are unstable. Remove them, and install @discordjs/opus instead.

Terminal window
bun remove opusscript node-opus
bun add @discordjs/opus

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;
});

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.

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.

A session expires, and the plugin cannot authenticate any more. Export a new one and give it to the plugin.

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" });

DisTube works with any command handler. A chat input command is in Discord.js events.

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.

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 ffmpegDebug output of a failing track
  • the code that reproduces the problem

On the Discord server.