Aeiddius
Aeiddius

Reputation: 378

Discord.js send hyperlink on normal message just like in user message

as a user, you can send hyperlink message in discord using

[Text](http://example.com)

and it'll be embedded like this:

enter image description here

.

however, if I used a Bot to do it with discord.js, using the code:

await source.channel.send("[text](http://example.com)")

it won't embed:

enter image description here

is it possible to do this like the user or it's simply impossible for bots to do it?

Upvotes: 2

Views: 2318

Answers (1)

vedran77
vedran77

Reputation: 65

You need to format that message into hyper link.

const msg = Formatters.hyperlink("", "http://example.com", text);
await source.channel.send(msg);

https://discord.js.org/#/docs/main/stable/class/Formatters?scrollTo=s-hyperlink

Upvotes: 4

Related Questions