all repos — telebonk @ 20171eaba4cfc881ed259b753b8d3d07079bc687

reposter from honk to telegram

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.
la-ninpre leobrekalini@gmail.com
Wed, 19 Oct 2022 22:20:51 +0300
commit

20171eaba4cfc881ed259b753b8d3d07079bc687

parent

76830e64e7e688c2e6e273d602f99d0746300770

1 files changed, 2 insertions(+), 2 deletions(-)

jump to
M main.gomain.go

@@ -170,8 +170,8 @@

// 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 @@ var messes = make([]*Mess, 0, 1+len(honk.Donks))

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/"):