1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-12-23 03:33:17 +00:00

Update voiceStateUpdate.js

This commit is contained in:
MatteZ02 2020-03-20 22:55:31 +02:00
parent 1a5fc5985c
commit b9f0eb3a96

View File

@ -1,6 +1,7 @@
module.exports = { module.exports = {
name: 'voiceStateUpdate', name: 'voiceStateUpdate',
async execute(client, oldState, newState) { async execute(client, oldState, newState) {
if (oldState.channel === null) return newState.setSelfDeaf(true);
let change = false; let change = false;
const queue = client.queue.get(newState.guild.id); const queue = client.queue.get(newState.guild.id);
if (!queue) return; if (!queue) return;
@ -17,7 +18,6 @@ module.exports = {
queue.connection = newState.connection; queue.connection = newState.connection;
} }
} }
if (oldState.channel === null) return;
if (oldState.channel.members.size === 1 && oldState.channel === queue.voiceChannel || change) { if (oldState.channel.members.size === 1 && oldState.channel === queue.voiceChannel || change) {
setTimeout(() => { setTimeout(() => {
if (!queue) return; if (!queue) return;