Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
krau committed Oct 10, 2024
1 parent dcc3f5f commit f9d51a6
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 16 deletions.
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,27 @@
# Save Any Bot
# Save Any Bot

把 Telegram 的文件保存到各类存储端.

> *就像 PikPak Bot 一样*
## 部署

[Release](https://github.com/krau/SaveAny-Bot/releases) 页面下载对应平台的二进制文件.

在解压后目录新建 `config.toml` 文件, 参考 [config.toml.example](https://github.com/krau/SaveAny-Bot/blob/main/config.example.toml) 编辑配置文件.

> [!TIP]
> 由于 Telegram 官方 Bot API 的限制, Bot 无法下载大于 20MB 的文件. 你需要部署一个本地的 Telegram Bot API 来解决这个问题, 然后将配置文件中的 telegram.api 改为你自己的 api 地址.
>
> 参考: [telegram-bot-api-compose](https://github.com/krau/telegram-bot-api-compose)
运行:

```bash
chmod +x saveany-bot
./saveany-bot
```

## 使用

向 Bot 发送(转发)文件, 按照提示操作.
33 changes: 18 additions & 15 deletions config.example.toml
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
[telegram]
token = ""
admins = []
token = "" # Bot Token
admins = [777000] # 你的 user_id
api = "https://api.telegram.org"

[log]
level = "DEBUG"
level = "DEBUG" # 日志等级

[temp]
base_path = "cache/"
cache_ttl = 30
base_path = "cache/" # 临时目录, 请不要在此目录下存放任何其他文件
cache_ttl = 30 # 临时文件保存时间, 单位: 秒

[db]
path = "data/data.db" # 数据库文件路径

[storage]
[storage.alist]
[storage.alist] # Alist
enable = true
base_path = "/telegram"
username = "admin"
password = "password"
url = "https://alist.com"
token_exp = 86400
base_path = "/telegram" # 保存路径
username = "admin" # 用户名
password = "password" # 密码
url = "https://alist.com" # Alist 地址
token_exp = 86400 # token 过期时间, 单位: 秒

[storage.local]
[storage.local] # 本地磁盘
enable = true
base_path = "downloads/"
base_path = "downloads/" # 保存路径

[storage.webdav]
[storage.webdav] # WebDav
enable = true
base_path = "/telegram"
username = "admin"
password = "password"
url = "https://alist.com/dav"
url = "https://alist.com/dav"

0 comments on commit f9d51a6

Please sign in to comment.