更好的管理模块与图片样式
对于开发者,若有意愿开发插件,请参考 插件开发文档
常见问题汇总
注意:以下内容仅供 Linux 环境下部署使用,Windows 环境下的部署不予解答
下载
git clone https://github.com/SilveryStar/Adachi-BOT.git
cd Adachi-BOT
mkdir config && cd config
touch setting.yml commands.yml cookies.yml
配置
> setting.yml
qrcode: false # 是否启用扫码登录
# 每次登录都需验证,Docker启动禁用,默认不启用
number: 12345678 # QQ 账号
password: "" # QQ 密码
master: 87654321 # BOT 持有者账号
header: "" # 命令起始符(可为空串"")
platform: 1 # 登录平台
# 1.安卓手机(默认) 2.aPad 3.安卓手表 4.MacOS 5.iPad
atUser: true # 是否启用回复时 at 用户,默认关闭
dbPort: 56379 # 数据库端口
# 修改该选项需同时修改 redis.conf -> port
intervalTime: 1500 # 指令操作冷却时间,单位毫秒,默认 1500ms
> cookies.yml
cookies:
- 米游社Cookies(可多个)
启动
# 若 BOT 账号为首次登录,需在宿主机完成设备验证 (Node.js version>=12.16)
npm install yaml oicq
npm run login
# 设备验证完成后,启动 docker
docker-compose up -d
插件
docker-compose stop
# 在 ./src/plugins 中加入或删除文件夹
docker-compose start
git clone https://github.com/SilveryStar/Adachi-BOT.git
cd Adachi-BOT
npm install
# 生成配置文件模板
npm run start
# 自行运行 Redis 数据库,默认端口 56379
# 暴露端口可在 /config/setting.yml 的 dbPort 中修改
# 使用 forever 模块启动
# 注意,请在 Node.js 版本高于 v12.16 且低于 v14 的环境中运行,参考 issues #14
npm run serve
在每次启动后,所有命令式指令的命令头会以指令键名为索引写入 /config/commands.yml
中,你可以修改并重启来自定义命令头:
- 在使用
help
时添加-k
参数可以查看指令对应的指令头 - 在命令头前使用双下划线可以屏蔽
/config/setting.yml
中的header
配置,如__mys
应用启动后,使用 header+help
查询权限对应的所有指令,如 header
设定为 #
时,即为 #help
, 使用 #help -k
查询指令的 key
# Adachi-BOT 使用 docker json-file 作为日志输出
# Docker 启动,查看日志目录
docker inspect --format='{{.LogPath}}' adachi-bot
# Forever 启动,查看日志目录
forever list
对于 Adachi-BOT v1.x
的用户,在启动应用前,将原版本中的 ./data/db/map.json
移动至新版本的项目根目录下,即可完成米游社绑定数据迁移