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;