准备
mkdir /data/bot
cd /data/bot
git clone http://github.com/monsterxcn/Genshin_QBot.git .
mkdir go-cqhttp
cd go-cqhttp
wget https://github.com/Mrs4s/go-cqhttp/releases/download/v1.0.0-beta7-fix2/go-cqhttp_linux_amd64.tar.gz
tar xvzf go-cqhttp_linux_amd64.tar.gz
配置
cd /data/bot
# 配置 Nonebot2
cp .env.example .env
nano .env
# 配置 go-cqhttp
nano go-cqhttp/config.yml
# 安装虚拟环境
python3 -m venv venv
source venv/bin/activate
pip install nb-cli
pip install nonebot-adapter-cqhttp
pip install nonebot-plugin-apscheduler
pip install Pillow
pip install playwright
playwright install
playwright install-deps
deactivate
守护
nano /etc/systemd/system/gocq.service
nano /etc/systemd/system/qqbot.service
systemctl start qqbot
systemctl status qqbot
systemctl stop qqbot
# 测试无误后添加开机启动任务
systemctl enable --now qqbot