mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-04-14 19:37:31 +08:00
streaming p0 fix: preserve upstream 400 body and cap stream edit length
This commit is contained in:
@@ -303,11 +303,15 @@ func (c *TelegramChannel) Send(ctx context.Context, msg bus.OutboundMessage) err
|
||||
}
|
||||
|
||||
if pID, ok := c.placeholders.Load(msg.ChatID); ok {
|
||||
htmlForEdit := htmlContent
|
||||
if len([]rune(htmlForEdit)) > 3500 {
|
||||
htmlForEdit = sanitizeTelegramHTML(markdownToTelegramHTML(splitTelegramText(plainTextFromTelegramHTML(htmlForEdit), 3500)[0]))
|
||||
}
|
||||
editCtx, cancelEdit := withTelegramAPITimeout(ctx)
|
||||
params := &telego.EditMessageTextParams{
|
||||
ChatID: chatID,
|
||||
MessageID: pID.(int),
|
||||
Text: htmlContent,
|
||||
Text: htmlForEdit,
|
||||
ParseMode: telego.ModeHTML,
|
||||
ReplyMarkup: markup,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user