I wanted to make an embed that contains a description with a URL on it. But I am getting an error:
RangeError [EMBED_DESCRIPTION]: MessageEmbed description must be a string.
My code:
player.on('trackAdd', (queue, track) => {
const embed = new MessageEmbed()
.setTitle('Queued')
.setDescription({text:`${track.title}`, URL: (`${track.url}`) })
queue.metadata.send({embeds: [embed]});
});
I am using discord.js v13 and node.js v16
You need to provide a string to setDescription, it won't accept an object.
You can use Markdown syntax to create a link though:
.setDescription(`[${track.text}](${track.url})`)
It will display a link where the URL is track.url and the link is track.text.
According to the discord.js guide, you can use embed.setURL('https://somedomain.tld') to achieve what you want.