gramjs icon indicating copy to clipboard operation
gramjs copied to clipboard

How to send a hyper link in the chat?

Open blacksabbatherMJ opened this issue 3 years ago • 2 comments

I'm trying to use below code but not working; Please advise message="<a href='https://www.google.com/'>Google</a>"; const send_chat_result = await this.client.invoke( new Api.messages.SendMessage({ peer: new Api.InputPeerChat({"chatId":id}), message: message, parse_mode: 'HTML', entities: entities }) );

blacksabbatherMJ avatar Aug 11 '22 01:08 blacksabbatherMJ

use client.sendMessage instead

https://gram.js.org/beta/classes/TelegramClient.html#sendMessage

painor avatar Aug 11 '22 10:08 painor

let message = "link to my website"; let file = [...someMediaFiles]; let formattingEntities = [new Api.MessageEntityTextUrl({offset:0, length:5, url:"https://example.com"})]; client.sendMessage(channel, {message, file, formattingEntities})

I want to send a link to the channel using the documentation. But it doesn't work, who can tell you what the problem is?

zugelman avatar Jan 15 '24 13:01 zugelman