diff --git a/src/modules/music.js b/src/modules/music.js index 52dfbc9..2b02dfc 100644 --- a/src/modules/music.js +++ b/src/modules/music.js @@ -596,7 +596,42 @@ command.callback = async function (msg, line) { }; } case "queue": - case "q": + case "q": { + if (!voiceStorage.has(msg.guildID)) + return "The bot is not in a voice channel"; + + const connection = voiceStorage.get(msg.guildID); + const queue = connection._music_queue; + if (queue.length === 0) return "Nothing else is currently queued"; + + const nowPlaying = connection._music_nowplaying; + + const now = Date.now(); + let nextTrack = now + (nowPlaying.length - (now - nowPlaying.start)); + const fields = []; + for (const index in queue.slice(0, 8)) { + const item = queue[index]; + fields.push({ + name: item.title ? `[${item.title}](${item.url})` : item.url, + value: `${formatTime(item.length)}\nAdded by: <@${ + item.addedBy + }>\n`, + inline: true, + }); + nextTrack += item.length; + } + + return { + embed: { + title: "Currently Queued", + color: 0x0088cc, + fields, + footer: { + text: queue.length > 9 ? `Showing 9/${queue.length}` : "", + }, + }, + }; + } case "remove": case "qr": case "lock":