新增第26章: NAS照片发送到Telegram

This commit is contained in:
2026-04-17 11:50:37 +08:00
parent ea7a3785b9
commit 4fefe2541b
50 changed files with 1692 additions and 448 deletions

View File

@@ -1145,3 +1145,70 @@ obsidian help
- Obsidian 应用必须运行才能使用 CLI
- 如果 Obsidian 未运行,会报错或无响应
- 内容中换行用 `\n`,制表符用 `\t`
## 26. NAS 照片发送到 Telegram (2026-04-17)
### 功能
从 NAS 照片目录(/Users/weishen/mnt/volume1/homes/shenwei/Photos/)复制照片并通过 Telegram 发送给用户。
### 前置要求
- NAS 照片目录已挂载到 `/Users/weishen/mnt/volume1/`
- Telegram bot 已配置account: bot1, target: 5038825565
### 操作步骤
#### 1. 查找照片
```bash
# 查看照片目录结构
ls /Users/weishen/mnt/volume1/homes/shenwei/Photos/MobileBackup/
# 查找具体照片
find /Users/weishen/mnt/volume1/homes/shenwei/Photos/MobileBackup/ -type f -name "*.jpg" | head -5
```
#### 2. 复制到 media 目录
```bash
cp /path/to/photo.jpg ~/.openclaw/media/inbound/
```
#### 3. 通过 OpenClaw 发送
```bash
/opt/homebrew/bin/openclaw message send \
--account bot1 \
--channel telegram \
--target 5038825565 \
--media ~/.openclaw/media/inbound/photo.jpg \
--message "📷 照片说明"
```
### 参数说明
| 参数 | 说明 |
|------|------|
| `--account` | Telegram bot 账号(如 bot1 |
| `--channel telegram` | 固定为 telegram |
| `--target` | 目标 chat ID比利哥: 5038825565 |
| `--media` | 图片路径 |
| `--message` | 说明文字 |
### 示例
```bash
# 复制并发送
cp "/Users/weishen/mnt/volume1/homes/shenwei/Photos/MobileBackup/5MP-9A3/2003/01/IMG_20030101_000059_151.jpg" ~/.openclaw/media/inbound/
/opt/homebrew/bin/openclaw message send --account bot1 --channel telegram --target 5038825565 --media ~/.openclaw/media/inbound/IMG_20030101_000059_151.jpg --message "📷 2003年照片"
```
### 照片目录结构
```
/Users/weishen/mnt/volume1/homes/shenwei/Photos/
├── MobileBackup/ # 手机备份
│ ├── 5MP-9A3/ # 设备名
│ │ └── 2003/
│ │ └── 01/
│ │ └── IMG_*.jpg
│ └── ...
├── Canon_DIGITAL_IXUS_400/
├── Canon_EOS_400D_DIGITAL/
└── ...
```