From 20171eaba4cfc881ed259b753b8d3d07079bc687 Mon Sep 17 00:00:00 2001 From: la-ninpre Date: Wed, 19 Oct 2022 22:20:51 +0300 Subject: remove parse mode from attachments donks (attachments) don't contain html. also they probably don't contain markdown either, so why bother parsing when it's possible to just deliver the text as-is. fix #10. --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 07a9689..f1a660a 100644 --- a/main.go +++ b/main.go @@ -170,8 +170,8 @@ func (h *Honk) forget() { // A Mess holds data for a message to be sent to Telegram. type Mess struct { Text string `json:"text"` - ParseMode string `json:"parse_mode"` ChatID string `json:"chat_id"` + ParseMode string `json:"parse_mode,omitempty"` MessageID int `json:"message_id,omitempty"` ReplyToMessageID int `json:"reply_to_message_id,omitempty"` @@ -211,7 +211,7 @@ func NewMessFromHonk(honk *Honk) []*Mess { messes = append(messes, NewMess("html")) for _, donk := range honk.Donks { - donkMess := NewMess("MarkdownV2") // donks don't contain html + donkMess := NewMess("") // donks don't contain html donkMess.Caption = TruncateNoise(donk.Desc, truncateWith, 1024) switch { case strings.HasPrefix(donk.Media, "image/"): -- cgit v1.2.3