[Bug] Sending a Telegram message chain twice duplicates mentions
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
The mention is prepended inside TelegramPlatformEvent.send_with_client, which mutates the caller's MessageChain. Start there and check how the At component's text is added to the Plain component. Copy the chain before prepending, then run the send path twice with a mock Telegram transport and confirm each request contains a single @alice prefix and the original chain is unchanged.
Written by the indexing model from the issue text.
Description
Bug description
The Telegram adapter prepends an At mention directly to the caller's Plain.text. A plugin that sends one MessageChain twice (for example, broadcasting a shared notice or retrying delivery) gets duplicate mentions in the second message. The original chain is also changed for subsequent use.
Reproduction
Create MessageChain([At(qq=1234, name="alice"), Plain("Please review")]) and call TelegramPlatformEvent.send_with_client twice with the same chain. A mock Telegram bot is enough to observe the outgoing requests.
Expected result
Each request sends @alice Please review, and the chain's plain component still contains Please review.
Actual result
The second request sends @alice @alice Please review. The component text now contains both prefixes.
Environment
Source at 23db1ad08064a8330a09077138ce8ecc05362219, Python 3.12, macOS. Reproduced with the production send method and the repository's mock Telegram transport.
- Dominant language
- Python
- Stars
- 46.4k
- Forks
- 3.4k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 111
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AstrBotDevs/AstrBot
-
[Bug] Telegram album debounce exceeds the maximum waitPossibly taken @123XieC claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
AstrBotDevs/AstrBot#11123 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
AstrBotDevs/AstrBot#11038 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
AstrBotDevs/AstrBot#11034 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
AstrBotDevs/AstrBot#10999 · 1 comment ·
Maintainers usually reply within 1 day
-
[Bug] OpenAI-compatible Gemini 工具 schema const 导致 400Possibly taken @arccat-114 claimed this 20 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
AstrBotDevs/AstrBot#10720 · 1 comment ·
Maintainers usually reply within 1 day
All issues in AstrBotDevs/AstrBot
Similar issues
-
plot_graph crashes when a mesh node has no m2m edgePossibly taken @tygvi claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
mllam/neural-lam#883 · 1 comment ·
Maintainers usually reply within 2 days
-
enhancement possible-duplicate
Difficulty 1/5 1-3 hours Newbie friendliness 78/100
AOSSIE-Org/PictoPy#1715 · 2 comments ·
Maintainers usually reply within 6 days
-
SQLite connector omits generated columns from the catalog, and drops relationships sourced on themOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
NVIDIA/auto-ontology#511 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ethereum/execution-specs#3996 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
cpp-best-practices/project_validator#267 ·
Maintainers usually reply within 1 day