Skip to content

Latest commit

 

History

History
103 lines (78 loc) · 1.95 KB

README.md

File metadata and controls

103 lines (78 loc) · 1.95 KB

1. Neko-Chan2

猫猫ちゃん二代目源代码。初代目

2. Prerequistes

2.1. Install NoneBot2

python -m venv Nekochan
cd Nekochan
source bin/activate
pip install nb-cli

2.1.1. Install Driver

nb driver install nonebot2[fastapi]
nb driver install nonebot2[websockets]

2.1.2. Install adapter install mirai

nb adapter install nonebot_adapter_mirai2

2.1.3. Install plugin

nb plugin install nonebot-plugin-apscheduler

2.2. Install Mirai2

下载安装包iTXTech/mcl-installer并运行

2.2.1. Install plugin

./mcl --update-package net.mamoe:mirai-api-http --type plugin --channel stable-v2

2.2.2. Configure plugin

运行一次,配置QQ号,退出

./mcl -u

编辑产生的配置文件

cat << EOF > ${MIRAI2_ROOT}/config/net.mamoe.mirai-api-http/setting.yml
adapters:
  - ws
debug: false
enableVerify: true
verifyKey: WRITE_YOUR_KEY_HERE
singleMode: false
cacheSize: 2048
adapterSettings:
  ws:
    host: 127.0.0.1
    port: 5700
EOF

2.2.3. Configure .env

cat << EOF > .env
ENVIRONMENT=prod
VERIFY_KEY=WRITE_YOUR_KEY_HERE
driver=~fastapi+~websockets

MIRAI_HOST=127.0.0.1
MIRAI_PORT=5700
MIRAI_QQ=["123456789"]
SUPERUSERS=[]
EOF

3. Start Bot

./mcl -u # Start Mirai2 first
nb run   # Start Nonebot2