Skip to content

Upgrading

They were deprecated in v5.2. Use the queue of the guild instead.

// ❌ Removed in v6
distube.pause(guildId);
distube.resume(guildId);
distube.stop(guildId);
distube.setVolume(guildId, 50);
distube.skip(guildId);
distube.previous(guildId);
distube.shuffle(guildId);
distube.jump(guildId, 2);
distube.setRepeatMode(guildId, 1);
distube.toggleAutoplay(guildId);
distube.addRelatedSong(guildId);
distube.seek(guildId, 30);
// ✅ The queue
const queue = distube.getQueue(guildId);
await queue.pause();
await queue.resume();
await queue.stop();
queue.setVolume(50);
await queue.skip();
await queue.previous();
await queue.shuffle();
await queue.jump(2);
queue.setRepeatMode(1);
queue.toggleAutoplay();
await queue.addRelatedSong();
await queue.seek(30);
// ❌ Removed in v6
queue.isPlaying();
queue.isPaused();
queue.playing;
// ✅ The properties
queue.paused;
queue.isActive; // false once the queue is stopped

InfoExtractorPlugin and PlayableExtractorPlugin now extend ExtractorPlugin and only change their type. A plugin that cannot play its own songs declares it:

// ❌ Before
class MyPlugin extends InfoExtractorPlugin {
async createSearchQuery(song) {
return `${song.name} ${song.uploader.name}`;
}
}
// ✅ Now
class MyPlugin extends ExtractorPlugin {
readonly playable = false;
async createSearchQuery(song) {
return `${song.name} ${song.uploader.name}`;
}
}

DisTube used to look for a playable version of a song in a single plugin. It now tries every searchable plugin, in the order they were registered, until one of them has a result. The metadata of the original song is kept.

// ❌ Before
const plugin = distube.plugins.find((p) => p.constructor.name === "MyPlugin");
// ✅ Now
const plugin = distube.getPlugin("my-source");
class MyPlugin extends ExtractorPlugin {
async init(distube) {
super.init(distube);
// The network calls, the sessions, the timers...
}
async destroy() {
// Release everything.
}
}

destroy() is called when the DisTube instance is destroyed, and when a plugin is replaced at runtime.

// ❌ Before: the search of the client had to be patched by hand
const results = await distube.search(query, { limit: 25 });
// ✅ Now
const result = await distube.search(query, { limit: 25 });
result.songs; // the songs
result.sources; // the plugins that contributed

The result of a plugin is a SearchResult too, so a result can be played without resolving it a second time.

import { PluginError, PluginErrorCode } from "@kattowo/distube";
throw new PluginError(PluginErrorCode.NOT_FOUND, "This track does not exist.");
// ✅ Now
const distube = await DisTube.create(client, { plugins: [new MyPlugin()] });

Discord made the DAVE end-to-end encryption mandatory in March 2026. Install @discordjs/voice 0.19.1 or later; DisTube enables DAVE on every connection. An older voice package fails with VOICE_CONNECT_FAILED after 30 seconds, even when a transport encryption library is installed.

DisTube does not include any music source any more: they are plugins. The option that used to turn a source on is gone, and the sources are given to the client instead:

// ❌ Before: an option of the client
const distube = new DisTube(client, { /* the option of the source */ });
// ✅ Now
const distube = new DisTube(client, { plugins: [new MyPlugin()] });

The play() method takes a voice channel and an options object, and it throws instead of emitting an error.

// ❌ Before
distube.play(message, "query");
// ✅ Now
await distube.play(message.member.voice.channel, "query", {
message,
member: message.member,
});

The error event changed its arguments.

// ❌ Before
distube.on("error", (channel, error) => {});
// ✅ Now
distube.on(Events.ERROR, (error, queue, song) => {});

The filters moved to the queue.

// ❌ Before
distube.filters.set(["nightcore"]);
// ✅ Now
queue.filters.set(["nightcore"]);