-
-
Notifications
You must be signed in to change notification settings - Fork 94
Frequently Asked Questions
Blazingly fast, reliable VMs in 16 global locations at an extremely affordable price!
Available locations: 🇺🇸 🇳🇱 🇸🇪 🇦🇹 🇳🇴 🇬🇧 🇨🇭 🇭🇰 🇸🇬 🇯🇵 🇦🇺
Premium DisTube Bots are hosted on this provider in Chicago 🇺🇸
All plans, even 4$ plan, use the below specification:
- CPU: AMD EPYC Milan
- SSD: Samsung Enterprise NVMe Storage
- Public Network Port: 10Gbps | 40Gbps (depends on location)
| CPU vCore |
RAM GB |
Storage GB |
Price US$ |
|---|---|---|---|
| 1 | 2 | 10 | $4 |
| 2 | 4 | 20 | $6 |
| 2 | 8 | 35 | $9 |
| 4 | 12 | 50 | $12 |
| 6 | 24 | 100 | $22 |
| 8 | 32 | 125 | $29 |
| 8 | 48 | 150 | $39 |
| 12 | 64 | 200 | $49 |
| 16 | 96 | 250 | $69 |
- FFmpeg is not installed
- Install FFmpeg on: Windows - Linux (Ubuntu, Mint,...)
Download FFmpeg from this repo if the download links are not available
- If you want to run FFmpeg from a custom path, or
ffmpeg-static.path, e.t.c., you can useffmpeg.pathoption.
- This is due to FFmpeg error.
- Check the FFmpeg log to check why it happens with
ffmpegDebugevent
import { Events } from "distube";
distube.on(Events.FFMPEG_DEBUG, console.log);4.1 Error: Cannot find module '@discordjs/opus'
4.2 RangeError: Source is too large
4.3 RangeError: offset is out of bounds
-
@discordjs/opuspackage is not installed, or you installednode-opusoropusscriptpackage (which is not stable)
- Install
@discordjs/opuspackage. Uninstallnode-opus,opusscriptif installed
# Using bun
bun remove opusscript node-opus
bun add @discordjs/opus
# Using npm
npm uninstall opusscript node-opus
npm install @discordjs/opus- It is due to your hosting/VPS network connection
-
Try to join the voice channel with
<DisTube>.voices.join(voiceChannel)before usingDisTube.play().
You can retry if this function throws the above error. -
Use a better network service (like the above VPS)
6.1 My bot plays a random song after finishing all the queue
6.2 How to turn off autoplay
6.3 How to change queue's default properties
- Autoplay is on by default.
- To turn it on/off by a command, use queue.toggleAutoplay().
- To change the queue's default setting, use initQueue event.
import { Events } from "distube";
distube.on(Events.INIT_QUEUE, queue => {
queue.autoplay = false;
queue.setVolume(50);
});- It is caused by requesting YouTube videos too fast.
- Use
cookiesoption (Guide: YouTube-Cookies).You have to sign in before getting the cookie. You may have to wait for YouTube to unblock your IP after getting this error.
- You are literally a Discord bot
- Use
cookiesoption (Guide: YouTube-Cookies).You have to sign in before getting the cookie.
- Playing YouTube age-restricted videos
- Use
cookiesoption (Guide: YouTube-Cookies).You have to sign in before getting the cookie. Your account information must be at least 18 years old.
- You are requested to github too many times (maybe due to restarting your bot). YouTubePlugin deps check their versions with github api so it can be rate-limited
- Disable check for updates temporarily with their env variables
process.env.YTSR_NO_UPDATE = "1";
process.env.YTDL_NO_UPDATE = "1";DisTube works with any command handler. For slash commands:
client.on("interactionCreate", async interaction => {
if (!interaction.isChatInputCommand()) return;
if (interaction.commandName === "play") {
const query = interaction.options.getString("query", true);
const voiceChannel = interaction.member?.voice?.channel;
if (!voiceChannel) {
return interaction.reply("You must be in a voice channel!");
}
await interaction.deferReply();
try {
await distube.play(voiceChannel, query, {
textChannel: interaction.channel,
member: interaction.member,
});
await interaction.editReply(`Searching for: ${query}`);
} catch (error) {
await interaction.editReply(`Error: ${error.message}`);
}
}
});In v5.2, shortcut methods like distube.pause(guild), distube.skip(guild), etc. are deprecated. Use queue methods directly:
// ❌ Deprecated (will be removed in v6.0)
distube.pause(message.guildId);
distube.skip(message.guildId);
// ✅ Recommended
const queue = distube.getQueue(message.guildId);
queue.pause();
queue.skip();This change provides:
- Better type safety
- More explicit code
- Easier error handling
- Better IDE autocompletion
The queue.playing property indicates the queue is active (has started playing), not that audio is currently outputting. It remains true when paused and only becomes false when stopped.
// ❌ Deprecated - don't use queue.playing (will be removed in v6.0)
if (queue.playing) { ... }
// ✅ Check if audio is currently playing
if (!queue.paused) { ... }
// ✅ Check if paused or stopped
if (queue.paused) { ... }
// ✅ Check if stopped
if (queue.stopped) { ... }Home - Installation - [Guide](DisTube Guide) - API Documentation - Discord Support