Add more commands
This commit is contained in:
@@ -6,12 +6,18 @@ class MusicQueue {
|
||||
this.looping = new Map();
|
||||
}
|
||||
|
||||
addToQueue(guildId, song) {
|
||||
addToQueue(guildId, song, front = false) {
|
||||
if (!this.queue.has(guildId)) {
|
||||
this.queue.set(guildId, []);
|
||||
}
|
||||
|
||||
this.queue.get(guildId).push(song);
|
||||
if (front) {
|
||||
// Add the song to the front of the queue
|
||||
this.queue.get(guildId).unshift(song);
|
||||
} else {
|
||||
// Add the song to the end of the queue
|
||||
this.queue.get(guildId).push(song);
|
||||
}
|
||||
}
|
||||
|
||||
async removeFromQueue(guildId) {
|
||||
@@ -38,6 +44,15 @@ class MusicQueue {
|
||||
return this.queue.get(guildId);
|
||||
}
|
||||
|
||||
async addToQueueFirst(guildId, song) {
|
||||
if (!this.queue.has(guildId)) {
|
||||
this.queue.set(guildId, []);
|
||||
}
|
||||
|
||||
this.removeFromQueue(guildId);
|
||||
this.queue.get(guildId).unshift(song);
|
||||
}
|
||||
|
||||
enableLooping(guildId) {
|
||||
this.looping.set(guildId, true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user