网络知识 娱乐 傻妞机器人安装完整教程【最新版】- 6月14日更新

傻妞机器人安装完整教程【最新版】- 6月14日更新

文章目录

  • 前言
  • 一、sillyGirl机器人简介
  • 一、搭建步骤
    • 1️⃣安装wget unzip gcc gcc-c++ git✨
    • 2️⃣傻妞一键安装命令🌼
    • 3️⃣安装node.js🌺
    • 4️⃣设置管理员🍬
    • 5️⃣node-noebot接入傻妞🍹
    • 6️⃣安装screen🥤
    • 7️⃣开启芝士🍇
  • 三、自定义中添加API配置🤳
  • 四、实现自定义扩展——插件👀
  • 总结✨✨✨


前言

🥇个人主页:@MIKE笔记
🥈文章专栏:技术教程
📣TG交流群:https://t.me/mike_note

微信公众号:MIKE小助手——可直接上车
需要安装另外一个机器人点击👉XDD机器人
傻妞命令大全点击👉sillyGirl傻妞命令大全
👉傻妞对接微信公众号教程

一、sillyGirl机器人简介

1.傻妞青龙扩展
可以发送命令控制青龙任务,添加青龙变量,查看任务日志等等!可对接其他项目。
2.配置扩展
在sillyGirl/conf/config.yaml文件配置各种API,让傻妞功能丰富多彩。目前支持返回图片和文本(包括链接)。样例文件见文末。
3.自定义文件功能扩展
在sillyGirl/develop/replies/文件夹内放入js等文件。可实现自定义扩展,支持定时推送。比如你可以放早报、外卖返利定时推送等。样例文件见文末。

一、搭建步骤

1️⃣安装wget unzip gcc gcc-c++ git✨

代码如下(示例):

yum install wget unzip gcc gcc-c++ git screen -y

2️⃣傻妞一键安装命令🌼

代码如下(示例):
注意❗:以前安装过傻妞的,先删除文件,进入root目录下,找到文件夹sillygirl,删除即可,然后在终端执行下面命令

s=sillyGirl;a=arm64;if [[ $(uname -a | grep "x86_64") != "" ]];then a=amd64;fi ;if [ ! -d $s ];then mkdir $s;fi ;cd $s;wget http://github.yanyuge.workers.dev/https://github.com/cdle/${s}/releases/download/main/${s}_linux_$a -O $s && chmod 777 $s;pkill -9 $s;$(pwd)/$s

如果上面命令提示404,那就是代理失效了,更换代理即可,目前可用代理👇

https://github.zhlh6.cn/
http://toolwa.com/github/
https://ghproxy.com/
https://gh.api.99988866.xyz/
https://git.metauniverse-cn.com/
https://xbkj.298998518.workers.dev/

更换方法:

s=sillyGirl;a=arm64;if [[ $(uname -a | grep "x86_64") != "" ]];then a=amd64;fi ;if [ ! -d $s ];then mkdir $s;fi ;cd $s;wget 将这几个加粗的文字用代理地址替代https://github.com/cdle/${s}/releases/download/main/${s}_linux_$a -O $s && chmod 777 $s;pkill -9 $s;$(pwd)/$s

例如:

s=sillyGirl;a=arm64;if [[ $(uname -a | grep "x86_64") != "" ]];then a=amd64;fi ;if [ ! -d $s ];then mkdir $s;fi ;cd $s;wget https://xbkj.298998518.workers.dev/https://github.com/cdle/${s}/releases/download/main/${s}_linux_$a -O $s && chmod 777 $s;pkill -9 $s;$(pwd)/$s

等命令运行完毕。
Ctrl + c 退出


3️⃣安装node.js🌺

代码如下(下载):

cd /usr/local  && wget https://nodejs.org/dist/v14.17.5/node-v14.17.5-linux-x64.tar.xz

代码如下(解压):

xz -dk node-v14.17.5-linux-x64.tar.xz  && tar -xvf node-v14.17.5-linux-x64.tar

代码如下(修改/etc/profile,添加到文件最后一行):

export NODE_HOME=/usr/local/node-v14.17.5-linux-x64
export PATH=$PATH:$NODE_HOME/bin
export NODE_PATH=$NODE_HOME/lib/node_modules

代码如下(生效配置文件):

source /etc/profile

代码如下(检查是否安装成功):

node -v
npm -v

4️⃣设置管理员🍬

代码如下(示例):

s=/etc/sillyGirl;if [ ! -d $s ];then mkdir $s; fi; echo "set qq masters 你的管理QQ号" > /etc/sillyGirl/sets.conf

5️⃣node-noebot接入傻妞🍹

代码如下(拉取node-noebot):

cd ~ && git clone https://ghproxy.com/https://github.com/takayama-lily/node-onebot.git

修改文件
手动去文件夹/root/node-onebot 到config.sample.js
先把config.sample.js改成config.js

代码如下(config.js修改):

ws_reverse_url: [ //反向ws地址,可以添加多个url
"ws://127.0.0.1:8080/qq/receive",

代码如下(启动sillyGirl):

cd && cd sillyGirl && ./sillyGirl -t

按键盘Ctrl + c

代码如下(静默sillyGirl):

./sillyGirl -d
cd && cd node-onebot && node main 机器人QQ

第一次登录,一定使用👺密码登陆,稳定性高点

如果选择扫码,有可能需要用到《滑块验证获取ticket教程》
扫码后可能如果出现登录环境异常,请看《解决扫码登录异常问题》
遇到反向链接失败请看解决《傻妞反向ws连接(ws://127.0.0.1:8080/qq/receive)被关闭,关闭码1006 ,将在3000毫秒后尝试连接》

按键盘 Ctrl + c 保存退出


6️⃣安装screen🥤

代码如下(示例):

yum -y install screen

等命令运行完毕。
Ctrl + c 退出

代码如下(创建scree会话):

screen -S node-onebot

运行出现空白

代码如下(再运行noebot):

cd && cd node-onebot && node main 机器人QQ

然后直接用按键的Ctrl + a + d 退出会话就行!
注意❗:请务必按照以上步骤来


7️⃣开启芝士🍇

注❗:聊天页面直接发送

代码如下(用管理员QQ给你的机器人QQ发送命令):

set jd_cookie enable_jd_cookie true

用管理员QQ给你的机器人QQ发送命令:

重启

❗后面扩展自行选择安装,不安装不影响基本使用❗

三、自定义中添加API配置🤳

在/root/sillyGirl/conf/config.yaml添加下面代码
插入位置

replies:
  #文本类型的回复
  - type: text
    rules:
      - 在吗
    content: 我是微信公众号:MIKE小助手,欢迎来撩!
  #链接类型回复
  - type: url
    rules:
      - 壁纸
      - 二次元
    request:
        #图片
        response_type: image 
        url: https://acg.toubiec.cn/random.php
  - type: url
    rules:
      - 姐姐
      - 妹妹
      - 小姐姐
    request:
        #图片
        response_type: image 
        url: http://api.btstu.cn/sjbz/zsy.php
  - type: url
    rules:
      - 舔狗日记
      - 舔狗
    request:
        #纯文本
        response_type: text
        url: https://api.oick.cn/dog/api.php
  - type: url
      - 股票 (.*)
    request:
        #纯文本
        response_type: text
        url: https://zyzcfa.com:444/api/stocks?keyword={{1}}
  - type: url
    rules:
      - 蓝奏云 (.*) (.*)
      - 蓝奏云 (.*)
      - 蓝奏云 (.*)密码:(.*)
    request:
        #纯文本
        response_type: json
        url: http://yingy.20wl.co/Api/php/LanZous.php?url={{1}}&pwd={{2}}
        get: data.url
  - type: url
    rules:
      - 游戏
      - 开始游戏
    request:
        #纯文本
        response_type: text
        url: http://hm.suol.cc/API/game_gs.php?msg=开始游戏
  - type: url
    rules:
      -(.*)
      -(.*)
    request:
        #纯文本
        response_type: text
        url: http://hm.suol.cc/API/game_gs.php?msg=答{{1}}
  - type: url
    rules:
      - 提示
    request:
        #纯文本
        response_type: text
        url: http://hm.suol.cc/API/game_gs.php?msg=提示
  - type: url
    rules:
      - ^查字s*(S*)$
    replace:
      - 
        - <br>

        - "n" 
    request:
        response_type: template
        url: https://api.tianapi.com/txapi/xhzd/index?key=19eea766886493ecd04e770d0c2b56f9&word={{1}}
        template: "汉字:gjson(newslist.[0].hanzi)n读音:gjson(newslist.[0].pyyb)n解释:gjson(newslist.[0].content)n拓展:gjson(newslist.[0].explain)"    
  # - type: url
  #   rules:
  #     - .*
  #   request:
  #       #纯文本
  #       response_type: json
  #       url: https://api.ixiaowai.cn/tgrj/index.php
  #       get: data.msg

效果图
效果图片

四、实现自定义扩展——插件👀

放在目录sillyGirl/develop/replies/在这里插入图片描述
傻妞插件合集下载,密码:MIKE

效果
效果样例——视频

总结✨✨✨

教程到此结束,教程本人实践不少于30次总结而来,如果操作失败,一定不是教程的问题!
🚦文章内代码仅用作个人学习备忘录,


更多相关教程👇👇👇技术教程👈专栏
在这里插入图片描述