mirror of
https://github.com/aydenjahola/discord-multipurpose-bot.git
synced 2025-10-03 19:51:33 +01:00
16 lines
564 B
JavaScript
16 lines
564 B
JavaScript
exports.requireVC = (interaction) => {
|
|
const userVC = interaction.member?.voice?.channel;
|
|
if (!userVC) throw new Error("❌ You need to be in a voice channel!");
|
|
|
|
const meVC = interaction.guild?.members?.me?.voice?.channel;
|
|
if (meVC && meVC.id !== userVC.id) {
|
|
throw new Error("❌ You must be in the same voice channel as me.");
|
|
}
|
|
return userVC;
|
|
};
|
|
|
|
exports.requireQueue = (client, interaction) => {
|
|
const q = client.distube.getQueue(interaction.guildId);
|
|
if (!q || !q.songs?.length) throw new Error("❌ Nothing is playing.");
|
|
return q;
|
|
};
|