mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2024-12-23 02:33:18 +00:00
Updated stop.js & voiceStateUpdate.js
This commit is contained in:
parent
ef18a08cc6
commit
40490d80dc
@ -9,8 +9,8 @@ module.exports = {
|
|||||||
const radio = client.radio.get(msg.guild.id);
|
const radio = client.radio.get(msg.guild.id);
|
||||||
if (client.funcs.check(client, msg, command)) {
|
if (client.funcs.check(client, msg, command)) {
|
||||||
client.funcs.statisticsUpdate(client, msg.guild, radio);
|
client.funcs.statisticsUpdate(client, msg.guild, radio);
|
||||||
radio.connection.destroy();
|
radio.connection?.destroy();
|
||||||
radio.audioPlayer.stop();
|
radio.audioPlayer?.stop();
|
||||||
client.radio.delete(msg.guild.id);
|
client.radio.delete(msg.guild.id);
|
||||||
msg.channel.send(client.messageEmojis["stop"] + client.messages.stop);
|
msg.channel.send(client.messageEmojis["stop"] + client.messages.stop);
|
||||||
}
|
}
|
||||||
|
@ -16,8 +16,8 @@ module.exports = {
|
|||||||
|
|
||||||
if (newState.channel === null) {
|
if (newState.channel === null) {
|
||||||
client.funcs.statisticsUpdate(client, newState.guild, radio);
|
client.funcs.statisticsUpdate(client, newState.guild, radio);
|
||||||
radio.connection.destroy();
|
radio.connection?.destroy();
|
||||||
radio.audioPlayer.stop();
|
radio.audioPlayer?.stop();
|
||||||
return client.radio.delete(newState.guild.id);
|
return client.radio.delete(newState.guild.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,8 +37,8 @@ module.exports = {
|
|||||||
);
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
client.funcs.statisticsUpdate(client, newState.guild, radio);
|
client.funcs.statisticsUpdate(client, newState.guild, radio);
|
||||||
radio.connection.destroy();
|
radio.connection?.destroy();
|
||||||
radio.audioPlayer.stop();
|
radio.audioPlayer?.stop();
|
||||||
client.radio.delete(oldState.guild.id);
|
client.radio.delete(oldState.guild.id);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -52,11 +52,11 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
if ((oldState.channel.members.size === 1 && oldState.channel === radio.voiceChannel) || change) {
|
if ((oldState.channel.members.size === 1 && oldState.channel === radio.voiceChannel) || change) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (!radio || !radio.connection.dispatcher || !radio.connection.dispatcher === null) return;
|
if (!radio || !radio.connection || !radio.connection === null) return;
|
||||||
if (radio.voiceChannel.members.size === 1) {
|
if (radio.voiceChannel.members.size === 1) {
|
||||||
client.funcs.statisticsUpdate(client, newState.guild, radio);
|
client.funcs.statisticsUpdate(client, newState.guild, radio);
|
||||||
radio.connection.destroy();
|
radio.connection?.destroy();
|
||||||
radio.audioPlayer.stop();
|
radio.audioPlayer?.stop();
|
||||||
client.radio.delete(newState.guild.id);
|
client.radio.delete(newState.guild.id);
|
||||||
}
|
}
|
||||||
}, 120000);
|
}, 120000);
|
||||||
|
Loading…
Reference in New Issue
Block a user