1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-11-14 03:30:18 +00:00
musix-oss/events/voiceStateUpdate.js

14 lines
512 B
JavaScript
Raw Normal View History

2020-02-05 20:02:53 +00:00
module.exports = {
name: 'voiceStateUpdate',
async execute(client, newMember) {
const serverQueue = client.queue.get(newMember.guild.id);
if (!serverQueue) return;
if (newMember === client.user) {
if (newMember.voice.channel !== serverQueue.voiceChannel) {
serverQueue.voiceChannel = newMember.voice.channel;
console.log(`Changed serverQueue voiceChannel since Musix was moved to a different channel!`);
}
}
}
}