change telegram msg to html

This commit is contained in:
Umputun
2018-10-25 11:29:55 -05:00
parent d46ba8e913
commit f550438236
+4 -4
View File
@@ -79,11 +79,11 @@ func (t *Telegram) Send(ctx context.Context, req request) error {
if req.comment.ParentID != "" {
from += " -> " + req.parent.User.Name
}
from = "*" + from + "*"
link := fmt.Sprintf("[comment](%s)", req.comment.Locator.URL+uiNav+req.comment.ID)
msg := fmt.Sprintf("%s\n\n%s\n\n%s", from, req.comment.Orig, link)
from = "<strong>" + from + "</strong>"
link := fmt.Sprintf(`<a href="%s">comment</a>`, req.comment.Locator.URL+uiNav+req.comment.ID)
msg := fmt.Sprintf("%s<p/>%s<p/>%s", from, req.comment.Text, link)
u := fmt.Sprintf("%s%s/sendMessage?chat_id=@%s&text=%s&parse_mode=Markdown&disable_web_page_preview=true",
u := fmt.Sprintf("%s%s/sendMessage?chat_id=@%s&text=%s&parse_mode=HTML&disable_web_page_preview=true",
t.apiPrefix, t.token, t.channelName, url.QueryEscape(msg))
r, err := http.NewRequest("GET", u, nil)
if err != nil {