forked from embee/woomy
fixed autoclear
This commit is contained in:
parent
fb31e369f8
commit
16f540de81
1 changed files with 2 additions and 3 deletions
|
@ -6,17 +6,16 @@ module.exports = (client, oldState, newState) => {
|
||||||
if (newState.channelID !== oldState.channelID) {
|
if (newState.channelID !== oldState.channelID) {
|
||||||
const guild = music.getGuild(newState.guild.id)
|
const guild = music.getGuild(newState.guild.id)
|
||||||
|
|
||||||
/* Reset queue, dispatcher, etc if Woomy is forcibly disconnected from the queue
|
// Reset queue, dispatcher, etc if Woomy is forcibly disconnected from the queue
|
||||||
if (guild.voiceChannel && !guild.voiceChannel.members.get(client.user.id) && guild.queue.length > 0) {
|
if (guild.voiceChannel && !guild.voiceChannel.members.get(client.user.id) && guild.queue.length > 0) {
|
||||||
guild.queue = []
|
guild.queue = []
|
||||||
guild.playing = false
|
guild.playing = false
|
||||||
guild.paused = false
|
guild.paused = false
|
||||||
guild.skippers = []
|
guild.skippers = []
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
// Auto-disconnect feature
|
// Auto-disconnect feature
|
||||||
if (guild.playing && guild.Channel && guild.voiceChannel.id === oldState.channelID) {
|
if (guild.playing && guild.channel && guild.voiceChannel.id === oldState.channelID) {
|
||||||
if (guild.voiceChannel.members.filter(member => !member.user.bot).size < 1) {
|
if (guild.voiceChannel.members.filter(member => !member.user.bot).size < 1) {
|
||||||
guild.autoDisconnect = true
|
guild.autoDisconnect = true
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue