Skip to content

Commit f219ca1

Browse files
committed
telegram reply only on first message
1 parent 3b5d049 commit f219ca1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/channels/telegram/telegram.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ func (c *TelegramChannel) Send(ctx context.Context, msg bus.OutboundMessage) err
180180
// The Manager already splits messages to ≤4000 chars (WithMaxMessageLength),
181181
// so msg.Content is guaranteed to be within that limit. We still need to
182182
// check if HTML expansion pushes it beyond Telegram's 4096-char API limit.
183+
replyToID := msg.ReplyToMessageID
183184
queue := []string{msg.Content}
184185
for len(queue) > 0 {
185186
chunk := queue[0]
@@ -200,9 +201,11 @@ func (c *TelegramChannel) Send(ctx context.Context, msg bus.OutboundMessage) err
200201
continue
201202
}
202203

203-
if err := c.sendHTMLChunk(ctx, chatID, htmlContent, chunk, msg.ReplyToMessageID); err != nil {
204+
if err := c.sendHTMLChunk(ctx, chatID, htmlContent, chunk, replyToID); err != nil {
204205
return err
205206
}
207+
// Only the first chunk should be a reply; subsequent chunks are normal messages.
208+
replyToID = ""
206209
}
207210

208211
return nil

0 commit comments

Comments
 (0)