mirror of
https://github.com/musix-org/musix-oss
synced 2024-12-23 03:33:17 +00:00
Updated looping
This commit is contained in:
parent
8c117edd1e
commit
970ec44de8
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,4 +1,6 @@
|
|||||||
.env
|
.env
|
||||||
serviceAccount.json
|
serviceAccount.json
|
||||||
|
package.json
|
||||||
|
package-lock.json
|
||||||
.vscode/
|
.vscode/
|
||||||
node_modules/
|
node_modules/
|
||||||
|
@ -14,12 +14,10 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!serverQueue.looping) {
|
if (!serverQueue.looping) {
|
||||||
client.secondaryQueue = [...serverQueue.songs]
|
|
||||||
serverQueue.looping = true;
|
serverQueue.looping = true;
|
||||||
message.channel.send(':repeat: Looping the queue now!');
|
message.channel.send(':repeat: Looping the queue now!');
|
||||||
} else {
|
} else {
|
||||||
serverQueue.looping = false;
|
serverQueue.looping = false;
|
||||||
client.secondaryQueue = [];
|
|
||||||
message.channel.send(':repeat: No longer looping the queue!');
|
message.channel.send(':repeat: No longer looping the queue!');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -35,9 +35,6 @@ module.exports = async function (video, message, voiceChannel, client, playlist
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
serverQueue.songs.push(song);
|
serverQueue.songs.push(song);
|
||||||
if (serverQueue.looping) {
|
|
||||||
client.secondaryQueue.push(song);
|
|
||||||
}
|
|
||||||
if (playlist) return undefined;
|
if (playlist) return undefined;
|
||||||
return message.channel.send(`:white_check_mark: **${song.title}** has been added to the queue!`);
|
return message.channel.send(`:white_check_mark: **${song.title}** has been added to the queue!`);
|
||||||
}
|
}
|
||||||
|
@ -17,10 +17,10 @@ module.exports = async function (guild, song, client, message, seek) {
|
|||||||
} else {
|
} else {
|
||||||
console.log(reason);
|
console.log(reason);
|
||||||
}
|
}
|
||||||
serverQueue.songs.shift();
|
if (serverQueue.looping) {
|
||||||
if (serverQueue.looping && serverQueue.songs.length === 0) {
|
serverQueue.songs.push(serverQueue.songs[0]);
|
||||||
serverQueue.songs = [...client.secondaryQueue];
|
|
||||||
}
|
}
|
||||||
|
serverQueue.songs.shift();
|
||||||
client.funcs.play(guild, serverQueue.songs[0], client, message);
|
client.funcs.play(guild, serverQueue.songs[0], client, message);
|
||||||
});
|
});
|
||||||
dispatcher.setVolume(serverQueue.volume / 10);
|
dispatcher.setVolume(serverQueue.volume / 10);
|
||||||
|
1
index.js
1
index.js
@ -25,7 +25,6 @@ client.commands = new Discord.Collection();
|
|||||||
client.events = new Discord.Collection();
|
client.events = new Discord.Collection();
|
||||||
client.cooldowns = new Discord.Collection();
|
client.cooldowns = new Discord.Collection();
|
||||||
client.queue = new Map();
|
client.queue = new Map();
|
||||||
client.secondaryQueue = [];
|
|
||||||
client.funcs = {};
|
client.funcs = {};
|
||||||
|
|
||||||
client.funcs.handleVideo = require('./funcs/handleVideo.js');
|
client.funcs.handleVideo = require('./funcs/handleVideo.js');
|
||||||
|
Loading…
Reference in New Issue
Block a user