mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6293] [MERGED] fix(tgbot): split long messages at line boundaries #6211
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#6211
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/6293
Author: @sanmaxdev
Created: 8/24/2026
Status: ✅ Merged
Merged: 8/24/2026
Merged by: @MHSanaei
Base:
main← Head:fix/telegram-message-paging📝 Commits (1)
8cb1f8ffix(tgbot): split long messages at line boundaries📊 Changes
2 files changed (+78 additions, -22 deletions)
View changed files
📝
internal/web/service/tgbot/tgbot_send.go(+43 -22)➕
internal/web/service/tgbot/tgbot_send_test.go(+35 -0)📄 Description
Summary
Split oversized Telegram replies at line boundaries while retaining the existing blank-line grouping. This keeps each page within the configured limit and preserves balanced HTML code wrappers.
Why
Individual-link batches use single line breaks, so the previous pagination path could pass the entire oversized reply through unchanged. The new regression test covers a 50-link reply without blank separators.
Closes #6274
Type of change
Areas affected
How was this tested?
go test ./internal/web/service/tgbot -count=1go test -race ./internal/web/service/tgbot -count=1make test-gogo vet ./...go build ./...git diff --checkBreaking changes
None.
Checklist
go build ./...and the test suite pass locally.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.