-
-
Notifications
You must be signed in to change notification settings - Fork 6
Komorebi edited this page Feb 12, 2024
·
2 revisions
Bot 主要配置。
Important
适配器或第三方插件所需的配置也应写在 Bot
下
driver
- 类型: str
- 默认值: "~fastapi"
SoraBot 运行所使用的 Driver。
adapters
- 类型: set[str]
- 默认值: {"~onebot.v11"}
SoraBot 所使用的 Adapter。
host
- 类型:
str
- 默认值:
127.0.0.1
SoraBot 监听的 IP / 主机名
port
- 类型:
int
- 默认值:
8120
SoraBot 监听的端口。
debug
- 类型:
bool
- 默认值:
False
是否以调试模式运行。
log_level
- 类型:
LevelName | int
- 默认值:
INFO
配置 SoraBot 日志输出等级,可以为 int
类型等级或等级名称。
参考 loguru 日志等级。
log_file
- 类型:
LevelName | tuple[LevelName]
- 默认值:
ERROR
SoraBot 的日志保存等级,必须为等级名称。如果为 LevelName 类型,则保存指定等级及以上的日志。如果为 tuple[LevelName] 类型,则保存指定等级的日志。
nickname
- 类型:
set[str]
- 默认值:
{"林汐", "Sora"}
机器人昵称,根据用户是否 @bot
或者是否以机器人昵称开头来判断是否是向机器人发送的消息。
command_start
- 类型:
set[str]
- 默认值:
{"/"}
命令的起始标记,用于判断一条消息是不是命令。仅适用于命令事件响应器。
command_sep
- 类型:
set[str]
- 默认值:
{"."}
命令的分隔标记,用于将文本形式的命令切分为元组(实际的命令名)。仅适用于命令事件响应器。
proxy_url
- 类型:
str | dict[str, str] | None
- 默认值:
None
HTTP 代理地址。
插件加载配置。
plugins
- 类型:
set[str]
- 默认值:
set()
加载的插件列表。
plugin_dirs
- 类型:
set[str]
- 默认值:
set()
插件目录列表。
whitelist
- 类型:
set[str] | None
- 默认值:
None
插件白名单,仅加载白名单中的插件。
blacklist
- 类型:
set[str] | None
- 默认值:
None
插件黑名单,不加载黑名单中的插件。
日志配置。
log_expire_timeout
- 类型:
int
- 默认值:
7
日志文件过期时间,单位: 天。
Sqlite 数据库配置.
url
- 类型:
str
- 默认值:
"sqlite://db.sqlite3"
Sqlite数据库 连接 URL.
[bot]
host = "127.0.0.1"
port = 2310
driver = "~fastapi+~httpx"
adapters = ["~onebot.v11", "~telegram"]
proxy_url = "http://127.0.0.1:7890"
alconna_use_command_start = true
alconna_auto_send_output = true
telegram_bots = [{ token = "1234567890:ABCDEFGHIJKLMNOPQRSTUVWXYZ" }]
[plugin]
plugin_dirs = ["sora/plugins"]
[database]
url = "sqlite://db.sqlite3"