mirror of
https://github.com/krau/SaveAny-Bot.git
synced 2026-09-06 16:16:47 +08:00
refactor: update config and readme
This commit is contained in:
@@ -1,5 +1,3 @@
|
|||||||
我真的服了😇, 目前没有什么好的 telegram mtproto sdk, 因此这个项目在运行时会产生很多因上游依赖的 bug 的终止, 能跑就是赢.
|
|
||||||
|
|
||||||
# Save Any Bot
|
# Save Any Bot
|
||||||
|
|
||||||
把 Telegram 的文件保存到各类存储端.
|
把 Telegram 的文件保存到各类存储端.
|
||||||
@@ -35,3 +33,12 @@ api = "http://localhost:8081"
|
|||||||
```
|
```
|
||||||
|
|
||||||
参考: [telegram-bot-api-compose](https://github.com/krau/telegram-bot-api-compose)
|
参考: [telegram-bot-api-compose](https://github.com/krau/telegram-bot-api-compose)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Thanks
|
||||||
|
|
||||||
|
- [gotd](https://github.com/gotd/td)
|
||||||
|
- [TG-FileStreamBot](https://github.com/EverythingSuckz/TG-FileStreamBot)
|
||||||
|
- [gotgproto](https://github.com/celestix/gotgproto)
|
||||||
|
- All the dependencies
|
||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
threads = 4 # 下载线程数
|
|
||||||
workers = 4 # 同时下载文件数
|
workers = 4 # 同时下载文件数
|
||||||
|
|
||||||
[telegram]
|
[telegram]
|
||||||
token = "" # Bot Token
|
token = "" # Bot Token
|
||||||
admins = [777000] # 你的 user_id
|
admins = [777000] # 你的 user_id
|
||||||
@@ -10,7 +10,7 @@ api_hash = "0123456789abcdef0123456789abcdef" # Telegram API Hash
|
|||||||
level = "DEBUG" # 日志等级
|
level = "DEBUG" # 日志等级
|
||||||
|
|
||||||
[temp]
|
[temp]
|
||||||
base_path = "cache/" # 临时目录, 请不要在此目录下存放任何其他文件
|
base_path = "cache/" # 下载文件临时目录, 请不要在此目录下存放任何其他文件
|
||||||
cache_ttl = 30 # 临时文件保存时间, 单位: 秒
|
cache_ttl = 30 # 临时文件保存时间, 单位: 秒
|
||||||
|
|
||||||
[db]
|
[db]
|
||||||
|
|||||||
+1
-5
@@ -8,9 +8,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
Threads int `toml:"threads" mapstructure:"threads"`
|
Workers int `toml:"workers" mapstructure:"workers"`
|
||||||
Workers int `toml:"workers" mapstructure:"workers"`
|
|
||||||
ChunkSize int32 `toml:"chunk_size" mapstructure:"chunk_size"`
|
|
||||||
|
|
||||||
Temp tempConfig `toml:"temp" mapstructure:"temp"`
|
Temp tempConfig `toml:"temp" mapstructure:"temp"`
|
||||||
Log logConfig `toml:"log" mapstructure:"log"`
|
Log logConfig `toml:"log" mapstructure:"log"`
|
||||||
@@ -76,9 +74,7 @@ func Init() {
|
|||||||
viper.AddConfigPath(".")
|
viper.AddConfigPath(".")
|
||||||
viper.SetConfigType("toml")
|
viper.SetConfigType("toml")
|
||||||
|
|
||||||
viper.SetDefault("threads", 3)
|
|
||||||
viper.SetDefault("workers", 3)
|
viper.SetDefault("workers", 3)
|
||||||
viper.SetDefault("chunk_size", 1024*1024)
|
|
||||||
|
|
||||||
viper.SetDefault("temp.base_path", "cache/")
|
viper.SetDefault("temp.base_path", "cache/")
|
||||||
viper.SetDefault("temp.cache_ttl", 3600)
|
viper.SetDefault("temp.cache_ttl", 3600)
|
||||||
|
|||||||
Reference in New Issue
Block a user