# 搭建环境指南（必读）

{% hint style="info" %}
本协议非云端RPC,所有功能包都在本地运行授权走网络，也就是说登陆收发消息等功能都在本地客户端完成，框架实现了PC协议和Mac协议。理论上PC/Mac都有的功能都支持，不存在的接口会陆续完善，请合理合法使用本框架。
{% endhint %}

{% hint style="danger" %}
声明:请不要用于非法用途恶意引流或营销等干扰微信生态等行为,对框架逆向破解有兴趣的童鞋破解前先upx解压一下框架后在拖进IDA或Hooper即可
{% endhint %}

* 本协议可以运行在任意平台，Windows、Linux、Arm 、Darwin等
* 本协议支持任意语言对接，研发人员需掌握任意一种等后端PHP、Python、JAVA、Go、Node.js...语言即可。
* 功能包采用WebApi方式调用 实时消息采用<mark style="color:red;">SocketIO v3 或 Websocket</mark> 对接。
* 内置插件框架可通过Lua插件响应任意账号任意消息 ，通过luaapi 调用任意功能(无需搭建lua环境)。

{% hint style="success" %}
安装包(默认体验1小时)

防失联:iPhone用户可添加一下联系人

iMessage：

<imessagebots@icloud.com>

[下载地址](http://161.189.114.223:43299/file/)
{% endhint %}

## 目录结构

```
WebPlugins 更新一些脚本 用户一般用不到
UsersConf 用户配置文件 存放设备信息以wxid命名 用于历史登陆 二次登陆
Plugins Lua插件目录
Logs 日志目录 
CronSchedules 定时任务脚本目录
```

## 搭建说明

{% hint style="success" %}
下载安装包后解压任意目录 并配置配置文件CoreConf.conf
{% endhint %}

{% hint style="danger" %}

#### 获取授权Token&#x20;

1. 访问 <https://developer.gitter.im/docs/welcome> 登陆 可用GitHub 或 Twitter 授权登陆。
2. 登陆成功后访问 <https://developer.gitter.im/apps> 系统会生成一个Token 将Token 填入配置文件中即可完成。

#### 配置文件说明CoreConf.conf

Port = "0.0.0.0:8898" #监听地址 框架自身提供WebApi和SocketIO服务器&#x20;

WorkerThread = 50 #工作线程 可根据账号数量或群数量酌情增加&#x20;

RSTVer = "v1.0.0" #默认版本号

&#x20;GitterToken = "xxxx" #填写 获取GitterToken&#x20;

SocketIOUrl = "" # 默认为空如果有需求的话 请填写你的SocketIO服务器地址 框架将作为SocketIO客户端与你的服务器进行通讯

SocketIOUrl = "ws\://127.0.0.1:8081/socket.io/?EIO=3\&transport=websocket"

框架可同时作为SocketIO服务端和客户端，可按照场景按需要配置

如:框架默认端监听端口8898既提供了WebApi 又提供了SocketIO服务器，开发者可开发SocketIO客户端链接此端口

同样开发者也可以开发SocketIO服务器,框架主动链接你的服务器 配置SocketIOUrl这个字段即可
{% endhint %}

{% hint style="info" %}
Windows用户请用cmd.exe 切换到软件目录执行./RSTBot.exe运行
{% endhint %}

{% hint style="success" %}
非Windows shell 切换到软件目录 终端运行./RSTBot
{% endhint %}

{% hint style="info" %}
启动成功后终端会输出Everything is OK 可以正常获取二维码扫码登陆微信即可登陆成功方可操作WebApi
{% endhint %}

{% hint style="danger" %}
集群搭建步骤

无需复制多个目录 配置好配置文件线程数量 建议线程数100-150 账号在线数量20-50

Linux：<mark style="color:purple;">./RSTBot "IP:PORT" "Token" 线程数 "SocketIOUrl"</mark>

&#x20;            <mark style="color:orange;">./RSTBot "0.0.0.0:8898" "1239909cfd662cf00b53b845d405f741f612758ec" 500      "ws\://127.0.0.1:8081/socket.io/?EIO=3\&transport=websocket"</mark>&#x20;

&#x20;           <mark style="color:orange;">./RSTBot "0.0.0.0:8898" "1239909cfd662cf00b53b845d405f741f612758ec" 500</mark> <mark style="color:red;">""</mark> 不需要SocketIOUrl配置为🈳️ 但是<mark style="color:red;">参数不能省略</mark>

多个实例公用一个配置文件
{% endhint %}

{% hint style="danger" %}
WebApi请求 需要添加HTTP请求头 Content-Type: application/json
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://babyqdoc.gitbook.io/wechatdocs/da-jian-huan-jing-zhi-nan-bi-du.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
