Fix: video-without-caption TG→MAX rejected as send-message.empty
Some checks failed
Build / build (push) Has been cancelled

v0.3.14 started sending format="markdown" for every TG→MAX forward
(including crossposts). For media-only posts (video without caption,
etc.) text ends up empty and MAX API rejects the payload with
  400 proto.payload errors.send-message.empty
because format is set but no text is present.

sendMaxDirectFormatted now drops format when text is "". This also
unsticks queued items that were retrying forever with the same 400.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Andrey Lugovskoy 2026-04-24 17:40:53 +04:00
parent 8b80bb8ff1
commit 77fa94914f

View file

@ -248,6 +248,10 @@ func (b *Bridge) sendMaxDirectFormatted(ctx context.Context, chatID int64, text
} `json:"link,omitempty"`
}
// format применяется только к тексту — при пустом тексте MAX отклоняет payload.
if text == "" {
format = ""
}
body := msgBody{Text: text, Format: format}
if attType != "" && token != "" {
body.Attachments = []attachment{{