配置文件详解
配置文件位置:plugins/lumenbridge/config.json,首次启动自动生成。所有缺失字段会自动补全,旧版本配置升级时不会丢失已有字段。
核心连接
json
"connection": {
"ws_type": 0,
"target": "ws://127.0.0.1:3001",
"listen_host": "0.0.0.0",
"listen_port": 3002,
"access_token": "",
"bot_qq": 114514
}| 字段 | 说明 |
|---|---|
ws_type | 0 = 正向 WS(连 NapCat,推荐),1 = 反向 WS(NapCat 主动连过来) |
target | 正向 WS 时填 NapCat 的 WS 地址 |
listen_host / listen_port | 反向 WS 时的本地监听地址与端口 |
access_token | 鉴权 Token,需与 NapCat 配置一致(可留空) |
bot_qq | 机器人 QQ 号(用于识别自己的消息,避免自回复) |
全局参数
json
"admin_qq": [123456789],
"main_group": "987654321,4644666",
"debug": false| 字段 | 说明 |
|---|---|
admin_qq | 超级管理员 QQ 列表,拥有最高权限 |
main_group | 主群号,支持单群(int)或多群(逗号分隔字符串) |
debug | 调试日志开关 |
群服互通
json
"sync": {
"chat_to_server_enable": true,
"chat_to_group_enable": true,
"join_to_group_enable": true,
"leave_to_group_enable": true,
"death_to_group_enable": true,
"server_start_to_group": true,
"chat_to_server_format": "[群聊] %s: %s",
"chat_to_group_format": "[玩家] %s: %s",
"join_format": "[玩家] %s 进服",
"max_message_length": 256
}各 *_enable 控制对应消息方向开关;*_format 用 %s 占位符自定义消息格式。
白名单绑定
json
"whitelist": {
"enable": true,
"auto_add": true,
"bind_keyword": "绑定白名单",
"unbind_keyword": "解绑白名单",
"remove_on_leave": true
}| 字段 | 说明 |
|---|---|
auto_add | 绑定后自动执行游戏 /whitelist add,关闭则只记录不进游戏 |
bind_keyword / unbind_keyword | 群内触发绑定/解绑的关键字 |
remove_on_leave | 退群时自动移除该玩家的游戏白名单 |
正则引擎
json
"regex_engine": {
"enable": true,
"only_on_main": true,
"admin_debug": false,
"command_timeout": 5.0
}规则库单独存放在 plugins/lumenbridge/rules.json,详见 正则规则引擎。
WebUI
json
"webui": {
"enable": true,
"host": "127.0.0.1",
"port": 8300,
"password": "*",
"secret": ""
}| 字段 | 说明 |
|---|---|
host | 监听地址,127.0.0.1 仅本机,0.0.0.0 允许外网(注意安全) |
port | WebUI 端口 |
password | 登录密码,* = 启动时生成随机密码并打印到控制台 |
secret | Token 签名密钥,留空自动生成 |
背景图
json
"background": {
"enable": true,
"api_url": "https://t.alcy.cc/fj",
"blur_strength": 0,
"cache_seconds": 600
}可对接任意「直接返回图片」的 API,blur_strength 控制毛玻璃模糊强度。
