docs: 更新文档和技能

This commit is contained in:
tukuaiai
2025-12-18 00:50:45 +08:00
parent 5a94b62cca
commit 1c37451a83
52 changed files with 5010 additions and 536 deletions
@@ -0,0 +1,19 @@
# 🤖 telegram-dev
> Telegram Bot Development Practical Experience
## Project Background
Problems and solutions encountered in Telegram Bot development, mainly involving message formatting, Markdown rendering, etc.
## Document List
| File | Description |
|:---|:---|
| [Telegram Markdown Code Block Format Fix Log 2025-12-15.md](./Telegram%20Markdown%20Code%20Block%20Format%20Fix%20Log%202025-12-15.md) | Telegram Markdown code block rendering issue fix |
## Tech Stack
- Python
- python-telegram-bot
- Telegram Bot API
@@ -0,0 +1,42 @@
# telegram Markdown Code Block Format Fix Log 2025-12-15
## Problem
Error when sending message after chart generation:
```
❌ Chart generation failed: Can't parse entities: can't find end of the entity starting at byte offset 168
```
## Cause
The Markdown code block format in the `header` message in `bot.py` is incorrect.
The original code used string concatenation, adding `\n` after ```, which prevented the Telegram Markdown parser from correctly recognizing the code block boundary:
```python
# Incorrect usage
header = (
"```\n"
f"{filename}\n"
"```\n"
)
```
## Fix
Changed to use triple-quoted strings, ensuring ``` is on its own line:
```python
# Correct usage
header = f"""Report in attachment
```
{filename}
{ai_filename}
```
"""
```
## Modified File
- `services/telegram-service/src/bot.py` lines 293-308