fix(telegram): disable link previews in bot messages #54

Merged
weiwen merged 1 commit from sandcastle/issue-53 into main 2026-07-07 20:25:07 +08:00
Owner

Summary

  • Adds link_preview_options(is_disabled: true) to every send_message and edit_message_text call inside MessageView::execute
  • All bot response messages (streaming edits, final render, error notices) now suppress Telegram's automatic web-page preview
  • Added no_preview() helper and a unit test to document the LinkPreviewOptions value used

Test plan

  • cargo test passes: 126 tests, 0 failures (up from 125)
  • cargo clippy -- -D warnings clean
  • cargo fmt --check passes
  • New unit test no_preview_disables_link_preview verifies is_disabled: true and all other fields false/None

Closes #53

🤖 Generated with Claude Code

## Summary - Adds `link_preview_options(is_disabled: true)` to every `send_message` and `edit_message_text` call inside `MessageView::execute` - All bot response messages (streaming edits, final render, error notices) now suppress Telegram's automatic web-page preview - Added `no_preview()` helper and a unit test to document the `LinkPreviewOptions` value used ## Test plan - [x] `cargo test` passes: 126 tests, 0 failures (up from 125) - [x] `cargo clippy -- -D warnings` clean - [x] `cargo fmt --check` passes - [x] New unit test `no_preview_disables_link_preview` verifies `is_disabled: true` and all other fields false/None Closes #53 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(telegram): disable link previews in all bot messages (#53)
All checks were successful
CI / check (pull_request) Successful in 1m34s
PR Triage — label changes-requested reviews / triage-review (pull_request) Successful in 1s
0445f39cf8
Set `link_preview_options(is_disabled: true)` on every `send_message` and
`edit_message_text` call inside `MessageView::execute` so Telegram never
generates a web-page preview for links in evie's responses.

Key decisions:
- Fix lives entirely in `execute` (the sole teloxide-touching method) so the
  pure planners and their tests are unaffected.
- Added `no_preview()` helper with a unit test to document and verify the
  `LinkPreviewOptions` value used.
- `mod.rs` direct sends (help, error, placeholder) are plain text with no
  linkable URLs and were left unchanged.

Closes #53

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
weiwen merged commit 51ab3e841e into main 2026-07-07 20:25:07 +08:00
weiwen deleted branch sandcastle/issue-53 2026-07-07 20:25:07 +08:00
Sign in to join this conversation.
No reviewers
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
weiwen/evie!54
No description provided.