0


原神QQ机器人云崽-Bot v3—Linux服务器保姆级搭建教程

原神QQ机器人云崽-Bot v3—Linux服务器保姆级搭建教程

一 、说明

以腾讯云的轻量应用服务器为例
CPU: 2核
内存: 2G
带宽:4M
云硬盘:40G

二、 环境准备

  1. 宝塔Linux面板
  2. Node.js(版本至少v16以上)
  3. Redis
  4. git
  5. Chromium

三、 安装步骤

(1)、云服务重装系统

  1. 点击更多选择重装系统
  2. 点击应用模板选择宝塔Linux面板
  3. 点击确认,扫码认证安装

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

(2)、宝塔Linux面板登录

  1. 点击实例名称进入查看详细,选择应用管理
  2. 复制 sudo /etc/init.d/bt default 命令,点击登录,选择一键免密登录
  3. 粘贴 sudo /etc/init.d/bt default 到命令行回车,查看宝塔面板登录信息
  4. 复制URL到浏览器地址行回车,输入用户名密码进行登录
  5. 登录成功后关联腾讯云API秘钥,宝塔面板进行监控管理服务器(怎么关联可以查看关联教程,这里就不详细教程了)

在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

(3)、安装node.js环境

  1. 点击左侧面板软件商店应用搜索框里搜索应node.js版本管理器,点击右侧安装
  2. 进入node.js版本管理器设置,选择16.19.1版本点击安装,在顶部命令行版本选择已安装的node.js

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

  1. 输入node -v检查版本
[root@VM-8-16-centos ~]# node -v
v16.19.1

(4)、安装Redis数据库

  1. 点击左侧面板软件商店应用搜索框里搜索Redis,点击右侧安装,等待安装完成就可以了

在这里插入图片描述
在这里插入图片描述

(5)、源码包安装git

  1. 检查git版本,如果出现not fount,请跳过第二步
git --version
[root@VM-8-16-centos ~]# git --version
 git version 1.8.3.1

2.移除git,输入命令 yum remove git

[root@VM-8-16-centos ~]# yum remove git
Loaded plugins: fastestmirror
Resolving Dependencies
--> Running transaction check
---> Package git.x86_64 0:1.8.3.1-23.el7_8 will be erased
--> Processing Dependency: git =1.8.3.1-23.el7_8 forpackage: perl-Git-1.8.3.1-23.el7_8.noarch
--> Processing Dependency: git forpackage: gettext-devel-0.19.8.1-3.el7.x86_64
--> Running transaction check
---> Package gettext-devel.x86_64 0:0.19.8.1-3.el7 will be erased
---> Package perl-Git.noarch 0:1.8.3.1-23.el7_8 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================
 Package                               Arch                           Version                                  Repository                     Size
===================================================================================================================================================Removing:
 git                                   x86_64                         1.8.3.1-23.el7_8                         @base                          22M
Removing fordependencies:
 gettext-devel                         x86_64                         0.19.8.1-3.el7                           @base                         1.4M
 perl-Git                              noarch                         1.8.3.1-23.el7_8                         @base                          57 k

Transaction Summary
===================================================================================================================================================
Remove  1Package(+2 Dependent packages)

Installed size:24M
Is this ok [y/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning:RPMDB altered outside of yum.Erasing: gettext-devel-0.19.8.1-3.el7.x86_64                                                                                             1/3Erasing: perl-Git-1.8.3.1-23.el7_8.noarch                                                                                                2/3Erasing: git-1.8.3.1-23.el7_8.x86_64                                                                                                     3/3Verifying: git-1.8.3.1-23.el7_8.x86_64                                                                                                     1/3Verifying: perl-Git-1.8.3.1-23.el7_8.noarch                                                                                                2/3Verifying: gettext-devel-0.19.8.1-3.el7.x86_64                                                                                             3/3Removed:
  git.x86_64 0:1.8.3.1-23.el7_8                                                                                                                    

Dependency Removed:
  gettext-devel.x86_64 0:0.19.8.1-3.el7                                     perl-Git.noarch 0:1.8.3.1-23.el7_8                                    

Complete!
  1. 安装相关依赖
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel 
yum install gcc-c++ perl-ExtUtils-MakeMaker
[root@VM-8-16-centos ~]# yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Package libcurl-devel-7.29.0-59.el7_9.1.x86_64 already installed and latest version
Package expat-devel-2.1.0-15.el7_9.x86_64 already installed and latest version
Package 1:openssl-devel-1.0.2k-25.el7_9.x86_64 already installed and latest version
Package zlib-devel-1.2.7-20.el7_9.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package gettext-devel.x86_64 0:0.19.8.1-3.el7 will be installed
--> Processing Dependency: git forpackage: gettext-devel-0.19.8.1-3.el7.x86_64
--> Running transaction check
---> Package git.x86_64 0:1.8.3.1-23.el7_8 will be installed
--> Processing Dependency: perl-Git =1.8.3.1-23.el7_8 forpackage: git-1.8.3.1-23.el7_8.x86_64
--> Processing Dependency:perl(Git)forpackage: git-1.8.3.1-23.el7_8.x86_64
--> Running transaction check
---> Package perl-Git.noarch 0:1.8.3.1-23.el7_8 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================
 Package               Arch           Version                     Repository    Size
=====================================================================================Installing:
 gettext-devel         x86_64         0.19.8.1-3.el7              base         320 k
Installing fordependencies:
 git                   x86_64         1.8.3.1-23.el7_8            base         4.4M
 perl-Git              noarch         1.8.3.1-23.el7_8            base          56 k

Transaction Summary
=====================================================================================
Install  1Package(+2 Dependent packages)

Total download size:4.8M
Installed size:24M
Is this ok [y/d/N]: y
Downloading packages:(1/3): gettext-devel-0.19.8.1-3.el7.x86_64.rpm                |320 kB  00:00:00(2/3): perl-Git-1.8.3.1-23.el7_8.noarch.rpm                   |56 kB  00:00:00(3/3): git-1.8.3.1-23.el7_8.x86_64.rpm                        |4.4MB00:00:00-------------------------------------------------------------------------------------
Total                                                    23MB/s |4.8MB00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing: perl-Git-1.8.3.1-23.el7_8.noarch                                  1/3Installing: git-1.8.3.1-23.el7_8.x86_64                                       2/3Installing: gettext-devel-0.19.8.1-3.el7.x86_64                               3/3Verifying: git-1.8.3.1-23.el7_8.x86_64                                       1/3Verifying: perl-Git-1.8.3.1-23.el7_8.noarch                                  2/3Verifying: gettext-devel-0.19.8.1-3.el7.x86_64                               3/3Installed:
  gettext-devel.x86_64 0:0.19.8.1-3.el7                                              

Dependency Installed:
  git.x86_64 0:1.8.3.1-23.el7_8          perl-Git.noarch 0:1.8.3.1-23.el7_8         

Complete!
[root@VM-8-16-centos ~]# yum install gcc-c++ perl-ExtUtils-MakeMaker
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Package gcc-c++-4.8.5-44.el7.x86_64 already installed and latest version
Package perl-ExtUtils-MakeMaker-6.68-3.el7.noarch already installed and latest version
Nothing to do
  1. 下载git源码包
wget http://mirrors.edge.kernel.org/pub/software/scm/git/git-2.39.0.tar.gz
[root@iZ2ze288p6zj6hl324qs5hZ ~]# wget http://mirrors.edge.kernel.org/pub/software/scm/git/git-2.39.0.tar.gz
--2023-02-2317:58:23--  http://mirrors.edge.kernel.org/pub/software/scm/git/git-2.39.0.tar.gz
Resolving mirrors.edge.kernel.org(mirrors.edge.kernel.org)...147.75.80.249,2604:1380:4601:e00::3
Connecting to mirrors.edge.kernel.org(mirrors.edge.kernel.org)|147.75.80.249|:80... connected.HTTP request sent, awaiting response...200OKLength:10562099(10M)[application/x-gzip]
Saving to: ‘git-2.39.0.tar.gz’

100%[=========================================================================================================>]10,562,099   623KB/s   in 11s    

2023-02-2317:58:35(948KB/s)- ‘git-2.39.0.tar.gz’ saved [10562099/10562099]
  1. 解压git压缩包
tar -zxvf git-2.39.0.tar.gz
[root@VM-8-16-centos ~]# ll
total 10364
drwxrwxr-x 27 root root    20480 Dec 1209:07 git-2.39.0-rw-r--r--1 root root 10562099 Dec 1221:16 git-2.39.0.tar.gz
  1. 安装git
(1) cd git-2.39.0
(2) ./configure
(3) make && make install
  1. 查看验证git版本
git --version
[root@VM-8-16-centos git-2.39.0]# git version
git version 2.39.0

说明:centos7的yum只为git提供了1.8.3.1的软件包,若要安装最新版本的git,请用源码包安装。

(6)、安装Chromium

yum -y install chromium
Installed:
  chromium.x86_64 0:110.0.5481.77-1.el7                                                                                                            

Dependency Installed:
  adwaita-cursor-theme.noarch 0:3.28.0-1.el7          adwaita-icon-theme.noarch 0:3.28.0-1.el7     at-spi2-atk.x86_64 0:2.26.2-1.el7             
  at-spi2-core.x86_64 0:2.28.0-1.el7                  atk.x86_64 0:2.28.1-2.el7                    audit-libs-python.x86_64 0:2.8.5-4.el7        
  avahi.x86_64 0:0.6.31-20.el7                        cairo-gobject.x86_64 0:1.15.12-4.el7         checkpolicy.x86_64 0:2.5-8.el7                
  chromium-common.x86_64 0:110.0.5481.77-1.el7        colord-libs.x86_64 0:1.3.4-2.el7             dconf.x86_64 0:0.28.0-4.el7                   
  flac-libs.x86_64 0:1.3.0-5.el7_1                    fribidi.x86_64 0:1.0.2-1.el7_7.1             gdk-pixbuf2.x86_64 0:2.36.12-3.el7            
  glib-networking.x86_64 0:2.56.1-1.el7               gnutls.x86_64 0:3.3.29-9.el7_6               graphite2.x86_64 0:1.3.10-1.el7_3             
  gsettings-desktop-schemas.x86_64 0:3.28.0-3.el7     gsm.x86_64 0:1.0.13-11.el7                   gstreamer1.x86_64 0:1.10.4-2.el7              
  gtk-update-icon-cache.x86_64 0:3.22.30-8.el7_9      gtk3.x86_64 0:3.22.30-8.el7_9                harfbuzz.x86_64 0:1.7.5-2.el7                 
  hicolor-icon-theme.noarch 0:0.12-7.el7              jasper-libs.x86_64 0:1.900.1-33.el7          jbigkit-libs.x86_64 0:2.0-11.el7              
  json-glib.x86_64 0:1.4.2-2.el7                      lcms2.x86_64 0:2.6-3.el7                     libXcomposite.x86_64 0:0.4.4-4.1.el7          
  libXcursor.x86_64 0:1.1.15-1.el7                    libXi.x86_64 0:1.7.9-1.el7                   libXinerama.x86_64 0:1.1.3-2.1.el7            
  libXrandr.x86_64 0:1.5.1-2.el7                      libXtst.x86_64 0:1.2.3-1.el7                 libasyncns.x86_64 0:0.8-7.el7                 
  libatomic.x86_64 0:4.8.5-44.el7                     libbrotli.x86_64 0:1.0.9-10.el7              libcanberra.x86_64 0:0.30-9.el7               
  libcanberra-gtk3.x86_64 0:0.30-9.el7                libcgroup.x86_64 0:0.41-21.el7               libepoxy.x86_64 0:1.5.2-1.el7                 
  libgusb.x86_64 0:0.2.9-1.el7                        libmodman.x86_64 0:2.0.1-8.el7               libogg.x86_64 2:1.3.0-7.el7                   
  libproxy.x86_64 0:0.4.11-11.el7                     libsemanage-python.x86_64 0:2.5-14.el7       libsndfile.x86_64 0:1.0.25-12.el7_9.1         
  libsoup.x86_64 0:2.62.2-2.el7                       libtdb.x86_64 0:1.3.18-1.el7                 libthai.x86_64 0:0.1.14-9.el7                 
  libtiff.x86_64 0:4.0.3-35.el7                       libusbx.x86_64 0:1.0.21-1.el7                libvorbis.x86_64 1:1.3.3-8.el7.1              
  libwayland-cursor.x86_64 0:1.15.0-1.el7             libwayland-egl.x86_64 0:1.15.0-1.el7         libxkbcommon.x86_64 0:0.7.1-3.el7             
  nettle.x86_64 0:2.7.1-9.el7_9                       nss-mdns.x86_64 0:0.14.1-9.el7               pango.x86_64 0:1.42.4-4.el7_7                 
  policycoreutils-python.x86_64 0:2.5-34.el7          pulseaudio-libs.x86_64 0:10.0-6.el7_9        python-IPy.noarch 0:0.75-6.el7                
  rest.x86_64 0:0.8.1-2.el7                           setools-libs.x86_64 0:3.3.8-4.el7            sound-theme-freedesktop.noarch 0:0.8-3.el7    
  trousers.x86_64 0:0.3.14-2.el7                      xkeyboard-config.noarch 0:2.24-1.el7        

Complete!
结尾出现代码这些表示安装成功

(7)、安装中文包

yum groupinstall fonts -y
Installed:
  cjkuni-uming-fonts.noarch 0:0.2.20080216.1-53.el7                        dejavu-sans-mono-fonts.noarch 0:2.33-6.el7                              
  dejavu-serif-fonts.noarch 0:2.33-6.el7                                   gnu-free-mono-fonts.noarch 0:20120503-8.el7                             
  gnu-free-sans-fonts.noarch 0:20120503-8.el7                              gnu-free-serif-fonts.noarch 0:20120503-8.el7                            
  google-crosextra-caladea-fonts.noarch 0:1.002-0.4.20130214.el7           google-crosextra-carlito-fonts.noarch 0:1.103-0.2.20130920.el7          
  google-noto-emoji-fonts.noarch 0:20180508-4.el7                          jomolhari-fonts.noarch 0:0.003-17.el7                                   
  khmeros-base-fonts.noarch 0:5.0-17.el7                                   liberation-mono-fonts.noarch 1:1.07.2-16.el7                            
  liberation-sans-fonts.noarch 1:1.07.2-16.el7                             liberation-serif-fonts.noarch 1:1.07.2-16.el7                           
  lklug-fonts.noarch 0:0.6-10.20090803cvs.el7                              lohit-assamese-fonts.noarch 0:2.5.3-2.el7                               
  lohit-bengali-fonts.noarch 0:2.5.3-4.el7                                 lohit-devanagari-fonts.noarch 0:2.5.3-4.el7                             
  lohit-gujarati-fonts.noarch 0:2.5.3-2.el7                                lohit-kannada-fonts.noarch 0:2.5.3-3.el7                                
  lohit-malayalam-fonts.noarch 0:2.5.3-2.el7                               lohit-marathi-fonts.noarch 0:2.5.3-2.el7                                
  lohit-nepali-fonts.noarch 0:2.5.3-2.el7                                  lohit-oriya-fonts.noarch 0:2.5.4.1-3.el7                                
  lohit-punjabi-fonts.noarch 0:2.5.3-2.el7                                 lohit-tamil-fonts.noarch 0:2.5.3-2.el7                                  
  lohit-telugu-fonts.noarch 0:2.5.3-3.el7                                  madan-fonts.noarch 0:2.000-11.el7                                       
  nhn-nanum-gothic-fonts.noarch 0:3.020-9.el7                              open-sans-fonts.noarch 0:1.10-1.el7                                     
  overpass-fonts.noarch 0:2.1-1.el7                                        paktype-naskh-basic-fonts.noarch 0:4.1-3.el7                            
  paratype-pt-sans-fonts.noarch 0:20101909-3.el7                           sil-abyssinica-fonts.noarch 0:1.200-6.el7                               
  sil-nuosu-fonts.noarch 0:2.1.1-5.el7                                     sil-padauk-fonts.noarch 0:2.8-5.el7                                     
  smc-meera-fonts.noarch 0:6.0-7.el7                                       stix-fonts.noarch 0:1.1.0-5.el7                                         
  thai-scalable-waree-fonts.noarch 0:0.5.0-7.el7                           ucs-miscfixed-fonts.noarch 0:0.3-11.el7                                 
  vlgothic-fonts.noarch 0:20130607-2.el7                                   wqy-microhei-fonts.noarch 0:0.2.0-0.12.beta.el7                         
  wqy-zenhei-fonts.noarch 0:0.9.46-11.el7                                 

Dependency Installed:
  gnu-free-fonts-common.noarch 0:20120503-8.el7    khmeros-fonts-common.noarch 0:5.0-17.el7    liberation-fonts-common.noarch 1:1.07.2-16.el7    
  nhn-nanum-fonts-common.noarch 0:3.020-9.el7      smc-fonts-common.noarch 0:6.0-7.el7         thai-scalable-fonts-common.noarch 0:0.5.0-7.el7   
  
Complete!
结尾出现代码这些表示安装成功

四、 部署Yunzai-Bot

(1)、克隆Yunzai-Bot项目

git clone --depth=1-b main https://gitee.com/Le-niao/Yunzai-Bot.git
[root@VM-8-16-centos ~]# git clone --depth=1-b main https://gitee.com/Le-niao/Yunzai-Bot.git
Cloning into 'Yunzai-Bot'...remote: Enumerating objects:1082, done.remote: Counting objects:100%(1082/1082), done.remote: Compressing objects:100%(1060/1060), done.remote: Total 1082(delta 22), reused 923(delta 4), pack-reused 0
Receiving objects:100%(1082/1082),27.98 MiB |2.74 MiB/s, done.
Resolving deltas:100%(22/22), done.

(2)、安装pnpm

进入Yunzai-Bot路径下
cd Yunzai-Bot
全局安装
npm install pnpm -g
加入pnpm软连接(提示-bash: pnpm: command not found)
ln -s /www/server/nodejs/v16.19.1/bin/pnpm /usr/bin 
查看pnpm版本
pnpm -v
[root@VM-8-16-centos ~]# pnpm -v
7.27.1

(3)、设置源安装依赖

设置源
pnpm config set puppeteer_download_host=https://npmmirror.com/mirrors
安装依赖
pnpm install -P
[root@VM-8-16-centos ~ Yunzai-Bot]# pnpm config set puppeteer_download_host=https://npmmirror.com/mirrors
[root@VM-8-16-centos ~ Yunzai-Bot]# pnpm install -PWARN  deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random()in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.Packages:+362+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Packages are hard linked from the content-addressable store to the virtual store.
  Content-addressable store is at:/root/.local/share/pnpm/store/v3
  Virtual store is at:             node_modules/.pnpm
Progress: resolved 498, reused 0, downloaded 497, added 362, done
node_modules/.pnpm/[email protected]/node_modules/puppeteer: Running install script, done in16.1s

dependencies:+ art-template 4.13.2+ chalk 5.0.1+ chokidar 3.5.3+ https-proxy-agent 5.0.1+ inquirer 8.2.4+ lodash 4.17.21+ log4js 6.5.2+ md5 2.3.0+ moment 2.29.3+ node-fetch 3.2.6+ node-schedule 2.1.0+ node-xlsx 0.21.0+ oicq 2.3.1+ patch-package6.5.0+ pm2 5.2.0+ puppeteer 13.7.0+ redis 4.1.0+ yaml 2.1.1devDependencies: skipped

Done in28.3s

(4)、启动云崽

进入Yunzai-Bot路径下
cd Yunzai-Bot
运行Yunzai-Bot(首次运行按提示输入登录)
node app
[root@VM-8-16-centos ~ Yunzai-Bot]# node app
欢迎使用Yunzai-Bot v3.0.0
请按提示输入完成QQ配置
? 请输入机器人QQ号(请用小号): 这里输入一个小号来作为机器人
?请输入登录密码(为空则扫码登录): [hidden]这里输入小号的密码,服务搭建需要密码,虚拟机局域网搭建则可以扫码登录
? 请选择登录端口: 安卓手表 这里选择安卓手表
? 请输入主人QQ号: 这里输入一个主QQ号,用来管理机器人
QQ配置完成,正在登录
后续修改账号可以运行命令: npm run login

[YzBot][22:36:10.570][MARK] Yunzai-Bot 启动中...[YzBot][22:36:10.571][MARK] 连接redis....[YzBot][22:36:10.579][MARK] 连接redis成功
[YzBot][22:36:10.590][MARK] 创建了新的设备文件:/root/Yunzai-Bot/data/xxxxxxxxxx/device-xxxxxxxxxx.json 
[YzBot][22:36:10.590][MARK]----------[YzBot][22:36:10.590][MARK] Package Version: [email protected](Released on 2022/6/21)[YzBot][22:36:10.590][MARK] View Changelogs:https://github.com/takayama-lily/oicq/releases
[YzBot][22:36:10.590][MARK]----------[YzBot][22:36:10.759][MARK] xxx.xxxx.xx:xxxx connected
[YzBot][22:36:11.066][MARK] Welcome,QQ! 正在加载资源...[YzBot][22:36:11.377][MARK] 加载了2个好友,0个群,0个陌生人
[YzBot][22:36:11.378][MARK]----^_^----[YzBot][22:36:11.378][MARK] Yunzai-Bot 上线成功 版本v3.0.0[YzBot][22:36:11.378][MARK] https://github.com/Le-niao/Yunzai-Bot
[YzBot][22:36:11.382][INFO] 加载插件中..[YzBot][22:36:11.537][INFO] 加载定时任务[2个][YzBot][22:36:11.537][INFO] 加载插件完成[14个][YzBot][22:36:11.538][INFO]-----------[YzBot][22:36:12.541][MARK] 发送好友消息[QQ](xxxxxxxxxx)[YzBot][22:36:12.628][INFO] succeed to send:[Private(xxxxxxxxxx)] 欢迎使用【Yunzai-Bot v3.0.0】
【#帮助】查看指令说明
【#状态】查看运行状态
【#日志】查看运行日志
【#更新】拉取github更新
【#全部更新】更新全部插件
【#更新日志】查看更新日志
【#重启】重新启动
【#配置ck】配置公共查询cookie
部署成功

在这里插入图片描述

(5)、基础操作

启动云崽: node app

查看日志: pnpm run log

后台运行: pnpm start

停止后台运行命令:pnpm stop

重启云崽:对着机器人发送 #重启

关闭云崽: 对着机器人发送 #关机,或者在关掉云崽运行窗口

功能列表: #帮助,#插件名称+帮助

更新云崽: #全部更新,#强制更新,#更新,git pull

重置云崽的部分设置(QQ 号,主人 QQ 等): pnpm run logi

(6)、Yunzai-Bot目录说明

目录说明config\config\qq.yaml可以修改登录方式,QQ 号config\config\redis.yamlredis的设置(非必要别修改)config\config\other.yaml可以修改主人 QQdata\face存放添加表情的位置data\MysCookie存放 cookie 的位置logs\存放日志文件的位置Yunzai-Bot\plugins\example存放 js 插件的位置Yunzai-Bot\plugins存放大型插件的位置,如喵喵插件

五、插件安装

说明:这里就安装一个锅巴插件为例,其它插件安装就自行研究。https://gitee.com/yhArcadia/Yunzai-Bot-plugins-index?_from=gitee_search

(1)、锅巴插件 (guoba-plugin)

第一步:下载插件,进入到Yunzai-Bot路径下

cd Yunzai-Bot

第二步:克隆锅巴插件项目

git clone --depth=1https://gitee.com/guoba-yunzai/guoba-plugin.git ./plugins/Guoba-Plugin/
[root@VM-8-16-centos plugins]# git clone --depth=1https://gitee.com/guoba-yunzai/guoba-plugin.git ./plugins/Guoba-Plugin/
Cloning into './plugins/Guoba-Plugin'...remote: Enumerating objects:395, done.remote: Counting objects:100%(395/395), done.remote: Compressing objects:100%(372/372), done.remote: Total 395(delta 9), reused 247(delta 6), pack-reused 0
Receiving objects:100%(395/395),5.87 MiB |916.00 KiB/s, done.
Resolving deltas:100%(9/9), done.

第三步:安装依赖

pnpm install --filter=guoba-plugin
[root@VM-8-16-centos plugins]# pnpm install --filter=guoba-plugin
plugins/plugins/Guoba-Plugin             |WARN  deprecated [email protected].|WARN  deprecated [email protected].|+174+++++++++++++++++Progress: resolved 537, reused 497, downloaded 39, added 174, done
Done in 3s

第四步:需要在腾讯云防火墙跟宝塔面板安全配置端口号:50831(锅巴端口)

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述
第五步:重新启动云崽,加载插件

对着机器人发送 #重启 或者 node app

在这里插入图片描述

第六步:登录锅巴后台

对着机器人发送 #锅巴登录,复制回复的链接进行登录

在这里插入图片描述
在这里插入图片描述

六、FAQ解决

(1)、遇到登录验证问题

两种方式都可以,这里以手动获取ticket方式验证为例
手动获取ticket
app获取验证

Yunzai-Bot手动获取ticket教程点击跳转

在这里插入图片描述

(2)、当前QQ版本过低,请升级至最新版本后再登录

[root@iZ2ze288p6zj6hl324qs5hZ Yunzai-Bot]# node app
[YzBot][16:19:14.772][MARK] Yunzai-Bot 启动中...[YzBot][16:19:14.774][MARK] 连接redis....[YzBot][16:19:14.785][MARK] 连接redis成功
[YzBot][16:19:14.795][MARK]----------[YzBot][16:19:14.795][MARK] Package Version: [email protected](Released on 2022/6/21)[YzBot][16:19:14.795][MARK] View Changelogs:https://github.com/takayama-lily/oicq/releases
[YzBot][16:19:14.795][MARK]----------[YzBot][16:19:14.942][MARK]120.241.150.69:8080 connected
[YzBot][16:19:15.155][ERRO][温馨提示]当前QQ版本过低,请升级至最新版本后再登录。点击进入下载页面
[YzBot][16:19:15.155][ERRO] 登录错误,已停止运行

解决方法:
进入到Yunzai-Bot\data\自己的QQ小号路径下(机器人QQ),修改json配置文件。

cd Yunzai-Bot/data/自己的QQ小号
修改配置,保存退出。
vi device-自己的QQ小号.json
说明:
i:按i进入编辑模式,进行编辑。
ESC:按ESC退出编辑模式,按:wq保存退出。

在这里插入图片描述

回到Yunzai-Bot路径,启动云崽。
cd Yunzai-Bot
node app

(3)、锅巴启动失败 缺少依赖:body-parse

[YzBot][16:48:34.700][MARK] Welcome,QQ! 正在加载资源...[YzBot][16:48:35.136][MARK] 加载了2个好友,0个群,0个陌生人
[YzBot][16:48:35.137][MARK]----^_^----[YzBot][16:48:35.138][MARK] Yunzai-Bot 上线成功 版本v3.0.0[YzBot][16:48:35.138][MARK] https://github.com/Le-niao/Yunzai-Bot
[YzBot][16:48:35.142][INFO] 加载插件中..[YzBot][16:48:35.203][MARK]---- 锅巴启动失败 ----[YzBot][16:48:35.204][MARK] 缺少依赖:body-parser
[YzBot][16:48:35.204][MARK] 请执行安装依赖命令:pnpm add body-parser -w
[YzBot][16:48:35.204][MARK]---------------------[YzBot][16:48:35.204][ERRO] TypeError: Cannot read properties ofundefined(reading 'includes')
    at PluginsLoader.load(file:///root/Yunzai-Bot/lib/plugins/loader.js:75:25)
    at async onlineEvent.execute(file:///root/Yunzai-Bot/lib/events/online.js:23:5)

解决方法:

安装依赖
pnpm install --filter=guoba-plugin
启动云崽
node app

本文转载自: https://blog.csdn.net/qq_43127208/article/details/129163931
版权归原作者 小白菜86 所有, 如有侵权,请联系我们删除。

“原神QQ机器人云崽-Bot v3—Linux服务器保姆级搭建教程”的评论:

还没有评论