Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can a Discord bot create a hyperlink in a Discord message in an embed or in general? [closed]

Today I did a lot of research on hyperlinks and how to use them. But everything I found didn't work as they were probably outdated…

How can my Discord.js bot send a message with a hyperlink? I know I can use .setTitle("Titel") and .setURL("https://...") to make a link in the embed title, but how can I use these hyperlinks elsewhere in the embed like in a field?

Also, it is possible to create a hyperlink just in a guild channel as a normal user?

Can someone help me in general with hyperlinks, or provide useful documentation which is not outdated?

like image 724
grafpatron Avatar asked Jul 29 '20 18:07

grafpatron


People also ask

How do I insert a hyperlink in Discord embed?

Just do [link text here](url here) .


1 Answers

Jakye is right. Only bots can achieve this (but not in field titles, beware). Just do [link text here](url here).

"Track cases globally, or in a country, by supplying 2-letter [country codes](https://countrycode.org/)."

This embed description results in:

this embed description

this in the embed. Clicking on it directs you to countrycode.org. Using .addField():

yourEmbed.addField("Title here, no hyperlinks allowed", "Main text here, so you can put a hyperlink here [like so.](https://example.com)");

If you want a bot's message to just be a hyperlink, you need to make an embed, and only set the description, hyperlinking as shown above. (you can set the embed color if you want too of course)

like image 71
MakeHellTal Avatar answered Oct 17 '22 22:10

MakeHellTal