'Hyperlink Markdown dynamically in discord
I'm trying to make an embed message where the title of the video is the link. To achieve that I'm using square brackets and parentheses around the objects, but they are being shown as strings in the message. Any ideas on how this could be done?
for (let i in listaResultados){
embed.addField(
`${parseInt(i)+1}: [${listaResultados[i].tituloVideo}](${listaResultados[i].link})`,
listaResultados[i].descricao)
}
Solution 1:[1]
Embed field names do not support markdown, including masked links.
Solution 2:[2]
I think there are couple solutions you can do.
- Utilize the Embed's title and url properties. However, this would limit you to producing only one embed per video, which means only 10 total (at one time) since 10 is the limit per message.
{
"embed": {
"title": "Music Video Title",
"description": "Description goes here",
"url": "https://video-url.com"
}
}
- The other way is to do what the other user mentioned - use the description field.
{
"embed": {
"title": "Music Videos List",
"description": "1. [Video 1](https://google.com) \n 2. [Video 2](https://google.com/) \n 3. [Video 3](https://google.com/)"
}
}
You can use this website for quick reference and experimentation of the embed code.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Diamond |
Solution 2 | zuko |