This commit is contained in:
dela
2026-01-08 23:07:12 +08:00
commit 7eaae93c4f
8 changed files with 537 additions and 0 deletions

21
README.md Normal file
View File

@@ -0,0 +1,21 @@
## Telegram Bot 适配
本项目已有生成 checkout URL 的逻辑(`autoteam.py``tg_bot.py` 提供 Telegram Bot API 的版本封装。
### 运行
1) 设置环境变量:
- `TG_BOT_TOKEN`BotFather 创建的 bot token必填
- `TG_ALLOWED_USER_IDS`:允许使用的 user_id 白名单(可选,多个用逗号分隔,强烈建议设置)
- `TG_ALLOW_GROUPS=1`:允许在群里使用(可选;默认仅私聊)
2) 启动:
`python bot.py`
`uv run bot.py`
### 使用
- `/gen <access_token>`:生成 checkout URL
- `/id`:查看自己的 `user_id`(用于配置白名单)