[PR #6293] [MERGED] fix(tgbot): split long messages at line boundaries #6211

Closed
opened 2026-11-02 04:07:09 +07:00 by bsakaguchi · 0 comments
Owner

📋 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)

  • 8cb1f8f fix(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

  • Bug fix

Areas affected

  • Telegram integration

How was this tested?

  • go test ./internal/web/service/tgbot -count=1
  • go test -race ./internal/web/service/tgbot -count=1
  • make test-go
  • go vet ./...
  • go build ./...
  • git diff --check

Breaking changes

None.

Checklist

  • I tested the change locally and confirmed the described behavior.
  • I added a regression test for the new behavior.
  • go build ./... and the test suite pass locally.
  • My commit follows the project's existing message style.
  • I have no unrelated changes mixed into this PR.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/MHSanaei/3x-ui/pull/6293 **Author:** [@sanmaxdev](https://github.com/sanmaxdev) **Created:** 8/24/2026 **Status:** ✅ Merged **Merged:** 8/24/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `fix/telegram-message-paging` --- ### 📝 Commits (1) - [`8cb1f8f`](https://github.com/MHSanaei/3x-ui/commit/8cb1f8f5789daecc6ccced89cdff6208810907bc) fix(tgbot): split long messages at line boundaries ### 📊 Changes **2 files changed** (+78 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `internal/web/service/tgbot/tgbot_send.go` (+43 -22) ➕ `internal/web/service/tgbot/tgbot_send_test.go` (+35 -0) </details> ### 📄 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 - [x] Bug fix ## Areas affected - [x] Telegram integration ## How was this tested? - `go test ./internal/web/service/tgbot -count=1` - `go test -race ./internal/web/service/tgbot -count=1` - `make test-go` - `go vet ./...` - `go build ./...` - `git diff --check` ## Breaking changes None. ## Checklist - [x] I tested the change locally and confirmed the described behavior. - [x] I added a regression test for the new behavior. - [x] `go build ./...` and the test suite pass locally. - [x] My commit follows the project's existing message style. - [x] I have no unrelated changes mixed into this PR. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:07:09 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#6211
No description provided.