Hyperlink in Node-RED ?

1,649 views
Skip to first unread message

n. Di

unread,
Oct 19, 2016, 1:08:42 PM10/19/16
to Node-RED
Hi Guys!

I'd like to send a link with a name + URL via Node-RED to Telegram Messenger.
Somehow I cannot figure out how to do this ?

Right now i use following function, which only sends the full link (without name).

var dashboard = 'https://........../ui/\n';

msg
.payload = {chatId : xxxxxx, type : 'message', content : dashboard};
return [ msg ];

How can I set this up with a name for the link? I don't want to see the full link in Telegram, but only the name which leads to the URL when I click it.
(Hopfully this is explained somehow reasonable)

Thank you!

Julian Knight

unread,
Oct 20, 2016, 2:02:42 AM10/20/16
to Node-RED
I've only used the two Telegram capable nodes to do this and at least one of them will take either HTML or Markdown and output to a Telegram message. I don't know how to do that manually I'm afraid. I expect the Telegram API documentation will tell you?

Assuming that the API supports HTML directly, all you would need would be something like:

var dashboard = '<a href="https://...../ui">Node-RED UI</a>'

bluem...@gmail.com

unread,
Oct 21, 2016, 5:05:28 AM10/21/16
to Node-RED
According to the Telegram API to set the parse_mode to "HTML" in your msg.payload.options. Then use the HTML format Julian already suggested and it should work!


n. Di

unread,
Oct 22, 2016, 5:45:40 AM10/22/16
to Node-RED
That did it!

Unfortunately, now I always get a Telegram security notification if I really want to open the link each time.

Julian Knight

unread,
Oct 24, 2016, 8:08:02 AM10/24/16
to Node-RED
What is the notification? Is it complaining about the lack of https?

n. Di

unread,
Nov 7, 2016, 7:39:09 AM11/7/16
to Node-RED
It just says "Open this link?"
Reply all
Reply to author
Forward
0 new messages