# Go-cqhttp

## 前言

Infinite Bot v3 摒弃了以往将 Mirai 嵌入程序主体的做法，转而使用高性能机器人 go-cqhttp 所提供的 websocket 与 http 服务。因此，您在使用本程序前应该先安装开启 go-cqhttp 服务。

## 须知

#### VPS(虚拟机)

如果你使用的VPS(虚拟机) 你可以完全按照以下教程进行部署

#### 面板(网页控制台形式)

如果你使用的面板(网页控制台形式),\
则你需要一台用于公网IP的机子(Windows/linux),\
并执行安装教程\
\[[Windows](#er-jin-zhi-an-zhuang)]\[Linux(等待好心人)]\
完成Go-cqhttp安装后安装Minecraft服务器插件 [InfiniteBot3](/infinitebot-shi-yong-wen-dang/an-zhuang/infinitebot3.md) \
俩者工作都完成后并按照[不同机子部署](/infinitebot-shi-yong-wen-dang/an-zhuang/bu-tong-ji-zi-bu-shu.md)修改你的配置使插件为远程连接

## 二进制安装

其详细步骤如下：

{% hint style="info" %}
请认真观看教程以便出现问题
{% endhint %}

1. 获取 go-cqhttp 的最新 [\[release\]](https://github.com/Mrs4s/go-cqhttp/releases)
2. 解压并运行解压后的可执行文件
3. 会出现以下提示,请输入02

   ```yaml
   未找到配置文件，正在为您生成配置文件中！
   请选择你需要的通信方式:
   > 0: HTTP通信
   > 1: 云函数服务
   > 2: 正向 Websocket 通信
   > 3: 反向 Websocket 通信
   请输入你需要的编号(0-9)，可输入多个，同一编号也可输入多个(如: 233)
   您的选择是: 0 2
   ```
4. 输入后回车,Go-cqhttp会自动生成配置[`config.yml`](/infinitebot-shi-yong-wen-dang/pei-zhi-wen-jian-gai-lan/go-cqhttp.md)&#x20;
5. `打开配置文件修改`\
   `account(账号) [修改为你机器人的bot信息]`\
   `servers(通信方式) [修改端口(也可以不修改,如果限制请修改)]` 节点
6.
7. 最后运行可执行文件，开启 go-cqhttp 服务。

若你的日志和[成功运行输出](/infinitebot-shi-yong-wen-dang/an-zhuang/go-cqhttp.md#cheng-gong-yun-hang-shu-chu)一致,代表你的Go-cqhttp搭建完毕,请转至`InfiniteBot 并完成下一步部署`

{% content-ref url="/pages/mWducTroCMGZ0Y1fhPHp" %}
[InfiniteBot3](/infinitebot-shi-yong-wen-dang/an-zhuang/infinitebot3.md)
{% endcontent-ref %}

## 成功运行输出

```
[2022-08-09 19:52:05] [INFO]: 登录成功 欢迎使用: xxx
[2022-08-09 19:52:05] [INFO]: 开始加载好友列表...
[2022-08-09 19:52:05] [INFO]: 共加载 x 个好友.
[2022-08-09 19:52:05] [INFO]: 开始加载群列表...
[2022-08-09 19:52:13] [INFO]: 共加载 x 个群.
[2022-08-09 19:52:13] [INFO]: 资源初始化完成, 开始处理信息.
[2022-08-09 19:52:13] [INFO]: アトリは、高性能ですから!
[2022-08-09 19:52:13] [INFO]: CQ HTTP 服务器已启动: [::]:5700
[2022-08-09 19:52:13] [INFO]: 正在检查更新.
[2022-08-09 19:52:13] [INFO]: CQ WebSocket 服务器已启动: [::]:8080
[2022-08-09 19:52:14] [INFO]: 检查更新完成. 当前已运行最新版本.
[2022-08-09 19:52:14] [INFO]: 开始诊断网络情况
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://infinitebot.gitbook.io/infinitebot-shi-yong-wen-dang/an-zhuang/go-cqhttp.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.
