Powerful Commands
🎵 Playback
📋 Queue
⚙️ Simulation
Try typing /play [song] below to see the bot in action.
Bot Configuration
Save your Discord bot credentials here. These settings will be stored in your private database.
Implementation Guide
To run this bot locally or on your server, ensure you have Node.js installed and use the following code based on your requirements (DisTube v4 + Discord.js v14).
npm install discord.js distube @distube/yt-dlp play-dl ffmpeg-static @discordjs/voice
const { Client, GatewayIntentBits } = require('discord.js');
const { DisTube } = require('distube');
const { YtDlpPlugin } = require('@distube/yt-dlp');
const ffmpeg = require('ffmpeg-static');
const client = new Client({
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildVoiceStates, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent]
});
const distube = new DisTube(client, {
emitNewSongOnly: true,
leaveOnFinish: false,
ffmpegPath: ffmpeg, // Fix for suara music
plugins: [new YtDlpPlugin()]
});
client.on('interactionCreate', async interaction => {
if (!interaction.isChatInputCommand()) return;
if (interaction.commandName === 'play') {
await interaction.deferReply(); // Anti-stuck
const query = interaction.options.getString('query');
distube.play(interaction.member.voice.channel, query, {
textChannel: interaction.channel,
member: interaction.member
});
await interaction.editReply(`Searching for: ${query}`);
}
});
client.login('YOUR_TOKEN_HERE');