aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorla-ninpre <leobrekalini@gmail.com>2022-10-19 22:20:51 +0300
committerla-ninpre <leobrekalini@gmail.com>2022-10-19 22:20:51 +0300
commit20171eaba4cfc881ed259b753b8d3d07079bc687 (patch)
tree4dcd10ad92335a584c9c6f7fe1353860501a53a9
parent76830e64e7e688c2e6e273d602f99d0746300770 (diff)
downloadtelebonk-20171eaba4cfc881ed259b753b8d3d07079bc687.tar.gz
telebonk-20171eaba4cfc881ed259b753b8d3d07079bc687.zip
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.
-rw-r--r--main.go4
1 files 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/"):