From 77fa94914f8cf152dc8997069f32b778c2d6a3e0 Mon Sep 17 00:00:00 2001 From: Andrey Lugovskoy Date: Fri, 24 Apr 2026 17:40:53 +0400 Subject: [PATCH] =?UTF-8?q?Fix:=20video-without-caption=20TG=E2=86=92MAX?= =?UTF-8?q?=20rejected=20as=20send-message.empty?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- upload.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/upload.go b/upload.go index 4983636..0c9c457 100644 --- a/upload.go +++ b/upload.go @@ -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{{