From de81037f059e637a2d435b631b4ea7b0be7008d2 Mon Sep 17 00:00:00 2001 From: MatteZ02 <47610069+MatteZ02@users.noreply.github.com> Date: Thu, 18 Jul 2019 19:36:36 +0300 Subject: [PATCH] Update index.js --- index.js | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/index.js b/index.js index d2b98f2c..460a3d67 100644 --- a/index.js +++ b/index.js @@ -139,13 +139,18 @@ Please provide a value to select one of the search results ranging from __1-10__ } else if (command === 'np') { if (!serverQueue) return msg.channel.send(':x: There is nothing playing.'); return msg.channel.send(`:musical_note: Now playing: **${serverQueue.songs[0].title}**`); - } else if (command === 'queue') { - if (!serverQueue) return msg.channel.send(':x: There is nothing playing.'); - return msg.channel.send(` -__**Song queue:**__ -${serverQueue.songs.map(song => `**-** ${song.title}`).join('\n')} -**Now playing:** ${serverQueue.songs[0].title} :musical_note: - `); + } else if (command === "queue") { + if (!serverQueue) + return msg.channel.send(":x: There is nothing in the queue."); + var queuemessage = `__**Song queue:**__ + ${serverQueue.songs.map(song => `**-** ${song.title}`).join("\n")} + **Now playing:** ${serverQueue.songs[0].title} :musical_note: `; + if (queuemessage.length < 2000) { + return msg.channel.send( + ":x: The queue has too many songs in it to show all in this channel. Try again after a few songs" + ); + } + return msg.channel.send(queuemessage); } else if (command === 'pause') { if (serverQueue && serverQueue.playing) { serverQueue.playing = false; @@ -264,13 +269,18 @@ Please provide a value to select one of the search results ranging from 1-10. } else if (command === 'np') { if (!serverQueue) return msg.channel.send(':x: There is nothing playing.'); return msg.channel.send(`:musical_note: Now playing: **${serverQueue.songs[0].title}**`); - } else if (command === 'queue') { - if (!serverQueue) return msg.channel.send(':x: There is nothing playing.'); - return msg.channel.send(` - __**Song queue:**__ - ${serverQueue.songs.map(song => `**-** ${song.title}`).join('\n')} - **Now playing:** ${serverQueue.songs[0].title} :musical_note: - `); + } else if (command === "queue") { + if (!serverQueue) + return msg.channel.send(":x: There is nothing in the queue."); + var queuemessage = `__**Song queue:**__ + ${serverQueue.songs.map(song => `**-** ${song.title}`).join("\n")} + **Now playing:** ${serverQueue.songs[0].title} :musical_note: `; + if (queuemessage.length < 2000) { + return msg.channel.send( + ":x: The queue has too many songs in it to show all in this channel. Try again after a few songs" + ); + } + return msg.channel.send(queuemessage); } else if (command === 'pause') { if (serverQueue && serverQueue.playing) { serverQueue.playing = false;