From ad6491ff140d44aa44c2661b0f773016ec34ee03 Mon Sep 17 00:00:00 2001 From: Umputun Date: Sat, 5 Jan 2019 17:48:39 -0600 Subject: [PATCH] tg link with post title --- backend/app/notify/telegram.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/app/notify/telegram.go b/backend/app/notify/telegram.go index a0653566..72b80c91 100644 --- a/backend/app/notify/telegram.go +++ b/backend/app/notify/telegram.go @@ -89,6 +89,9 @@ func (t *Telegram) Send(ctx context.Context, req request) error { } from = "*" + from + "*" link := fmt.Sprintf("↦ [original comment](%s)", req.comment.Locator.URL+uiNav+req.comment.ID) + if req.comment.PostTitle != "" { + link = fmt.Sprintf("↦ [%s](%s)", req.comment.PostTitle, req.comment.Locator.URL+uiNav+req.comment.ID) + } u := fmt.Sprintf("%s%s/sendMessage?chat_id=@%s&parse_mode=Markdown&disable_web_page_preview=true", t.apiPrefix, t.token, t.channelName)