Skip to content
This repository has been archived by the owner on Jun 18, 2022. It is now read-only.

Commit

Permalink
protect against embed char limits
Browse files Browse the repository at this point in the history
fixes  #3
  • Loading branch information
vachanmn123 authored Feb 22, 2022
1 parent eb80067 commit 807b04d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion commands/music/queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ module.exports = {
execute(message, args) {
const queue = message.client.distube.getQueue(message)
if (!queue) return message.channel.send(`There is nothing playing!`)
const q = queue.songs.map((song, i) => `${i === 0 ? "Playing:" : `${i}.`} ${song.name} - \`${song.formattedDuration}\``).join("\n")
let q = queue.songs.map((song, i) => `${i === 0 ? "Playing:" : `${i}.`} ${song.name} - \`${song.formattedDuration}\``).join("\n")
if (q.length >= 1020) q = `${q.slice(0, 1020)}...`
const embed = new MessageEmbed()
.setColor("#101010")
.setTitle("Queue")
Expand Down

0 comments on commit 807b04d

Please sign in to comment.