完成安装部分

This commit is contained in:
lxbpxylps@126.com 2021-10-08 17:06:20 +08:00
parent cd641d13c1
commit 4ceda01a43
9 changed files with 129 additions and 6 deletions

View File

@ -2,9 +2,15 @@
> 欢迎来到 AkashicQQ 官方 wiki > 欢迎来到 AkashicQQ 官方 wiki
**AkashicQQ基于 [NoneBot](https://github.com/nonebot/nonebot2) 框架的异步 QQ 机器人,为你的服务器打造 QQ 群和游戏的一体化体验。** **AkashicQQ基于 [NoneBot](https://github.com/nonebot/nonebot2) 框架的异步 QQ 机器人,为你的 Minecraft 服务器打造 QQ 群和游戏的一体化体验。**
AkashicQQ 拥有许多的功能,其配置方法也相对复杂,本 Wiki 旨在详细介绍 AkashicQQ 的功能和配置方法,让您轻轻松松部署您的 QQ 机器人。 AkashicQQ 支持多服务器 Q 群聊天、跨服聊天、服务器事件播报、远程执行命令等多种功能。它可以在 Windows 或 Linux 上运行无需特定平台。此外Akashic Server 支持原版、Spigot、Forge 等多种服务端,并在命令输出返回等方面有独特的优势。
AkashicQQ 拥有许多功能,其配置方法也相对复杂,本 Wiki 旨在详细介绍 AkashicQQ 的功能和配置方法,让您轻轻松松部署您的 QQ 机器人。
![433142833](/_media/qrcode.png)
> 加群密码prism
联系我们:[mc@akashic.cc](mailto:mc@akashic.cc) 联系我们:[mc@akashic.cc](mailto:mc@akashic.cc)

BIN
_media/akashic-folder.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
_media/prism-folder.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

BIN
_media/qrcode.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
_media/structure.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -1,3 +1,5 @@
# 配置文件 # 配置文件
AkashicQQ 有许多配置文件。本部分将对各个配置文件的配置方法一一介绍。 AkashicQQ 有许多配置文件。本部分将对各个配置文件的配置方法一一介绍。
> 注意:至少完成左侧栏中的 `.env` `group.md` `mc_server.json` 三项配置才能正常使用 AkashicQQ。

View File

@ -1,6 +1,6 @@
# group.json # group.json
> 注意group.json 及其之后的配置文件均为 JSON 格式,位于根目录下的 config 文件夹中。请使用 UTF-8 格式编辑和保存配置文件,并确保配置文件符合 JSON 格式。 > 注意group.json 及其之后的配置文件均为 JSON 格式,位于根目录下的 config 文件夹中。请使用 UTF-8 编码编辑和保存配置文件,并确保配置文件符合 JSON 格式。
{ {
"main_group": 123456789, "main_group": 123456789,

View File

@ -25,4 +25,4 @@
`server` 项为您每一个服务器的具体配置。 `server` 项为您每一个服务器的具体配置。
+ `tag`:服务器 Prism Console 的 tag + `tag`:服务器 Prism Console 的 tag
+ `url`:服务器 Prism Console API 对应的 url 地址,即 `http://{host}:{port}` + `url`:服务器 [Prism Console API](install?id=安装-prism-console) 对应的 url 地址,即 `http://{address}:{port}`

View File

@ -6,6 +6,8 @@
AkashicQQ 由以下几个模块构成,模块之间通过网络连接: AkashicQQ 由以下几个模块构成,模块之间通过网络连接:
<img src="_media/structure.png" width="50%">
+ [AkashicQQ 机器人本体](https://github.com/Mythologyli/AkashicQQ)(一个 Python 程序) + [AkashicQQ 机器人本体](https://github.com/Mythologyli/AkashicQQ)(一个 Python 程序)
+ [Prism Console](https://github.com/Mythologyli/Prism)(一个 Python 程序) + [Prism Console](https://github.com/Mythologyli/Prism)(一个 Python 程序)
+ cqhttp(onebot) 协议实现程序,如 [go-cqhttp](https://github.com/Mrs4s/go-cqhttp)、[onebot-kotlin](https://github.com/yyuueexxiinngg/onebot-kotlin)、[OneBot-YaYa](https://github.com/Yiwen-Chan/OneBot-YaYa) 等等 + cqhttp(onebot) 协议实现程序,如 [go-cqhttp](https://github.com/Mrs4s/go-cqhttp)、[onebot-kotlin](https://github.com/yyuueexxiinngg/onebot-kotlin)、[OneBot-YaYa](https://github.com/Yiwen-Chan/OneBot-YaYa) 等等
@ -22,8 +24,121 @@ AkashicQQ 并不能直接与腾讯的服务器通讯,而要借助 cqhttp(onebo
## 安装前的准备 ## 安装前的准备
+ 一个 QQ 账号,用于充当机器人。请确保此 QQ 号为您的服务器群的管理员。
## 安装 Prism Console ## 安装 Prism Console
> 注意Prism Console 需要与您的 Minecraft 服务器安装在一起
1. 为了安装 Prism Console您需要首先安装 [Python](https://www.python.org/) 环境。推荐安装 Python 3.8+
+ Windows
在 Python 官网上下载 Python3 并安装。注意在安装时勾选添加 Python 至系统 PATH。
Python 3.8.10 64位 [官方下载链接](https://www.python.org/ftp/python/3.8.10/python-3.8.10-amd64.exe)
+ Linux
您可以使用您的包管理器安装 Python 环境,例如 `sudo apt install python3 python3-pip`。请一并安装 pip。
2. 通过[下载链接](https://hub.akashic.cc/Myth/Prism/archive/main.zip)下载 Prism Console。解压得到如下内容
<img src="_media/prism-folder.png" width="30%">
3. 将 prism 文件夹、prism.py、prism_config.json、requirements.txt 文件复制到服务器根目录下。
4. 编辑 prism_config.json。
> 注意:请使用 UTF-8 编码打开和保存 JSON 文件。
{
"level": "DEBUG",
"shell": {
"start_cmd": "./start.sh",
"stop_cmd": "stop",
"read_encoding": "utf-8",
"write_encoding": "utf-8"
},
"api": {
"address": "127.0.0.1",
"port": 8520,
"tag": "主服"
},
"webhook": {
"url": "http://127.0.0.1:8080/",
"tag": "主服",
"event": {
"ServerStart": true,
"ServerStop": true,
"PlayerJoin": true,
"PlayerQuit": true,
"PlayerChat": true,
"PlayerAdvancement": true
}
}
}
+ `level`:调试等级,可为 DEBUG 或 INFO。建议保持 DEBUG方便安装期间定位问题。
+ `shell`:命令行相关配置。
+ `start_cmd`:服务器启动命令。可以是 `java -jar server.jar` 之类的命令,也可以是 start.bat ./start.sh 之类的脚本。
+ `stop_cmd`:服务器关闭命令。一般无需更改。
+ `read_encoding`:读命令行时采用的编码。一般在中文版 Windows 上填写 gbkLinux 上填写 utf-8。
+ `write_encoding`:写命令行时采用的编码。一般在中文版 Windows 上Spigot 系服务器填写 gbkForge 系服务器填写 utf-8。Linux 上填写 utf-8。
> 注意:当出现游戏内消息乱码、控制台输入输出乱码时,请尝试更改以上两个配置项。
+ `api`API 相关配置。
+ `address`API 绑定的 IP 地址。如果 Prism Console 和 AkashicQQ 安装在一起可以填写 127.0.0.1。
> 注意:当 `address` 项设置为 0.0.0.0 时API 可能暴露在公网上,请通过配置防火墙的方式确保安全。
+ `port`API 绑定的端口。
+ `tag`:服务器的 tag。请填写唯一、可读的名称如“主服”每个 Prism Console 的 tag 不能相同。
+ `webhook`Webhook 相关配置。
+ `url`:服务器事件上报地址,即 http://{AkashicQQ 的 IP}:{AkashicQQ 的端口}。
+ `tag`:与上面的 `tag` 保持一致。
+ `event`:哪些事件会被上报。无需更改。
5. 将服务器根目录在终端中打开。在命令行输入 `pip3 install -r requirements.txt` 安装依赖。
> 提示:[如何将当前文件夹在终端打开?](https://jingyan.baidu.com/article/1974b289c2e6f6f4b0f77466.html)
> 提示pip3 连接缓慢?[为 pip3 更换软件源](https://www.cnblogs.com/chenlizhi/p/13742163.html)
6. 命令行输入 `python3 prism.py`(Linux) 或 `python prism.py`(Windows) 运行 Prism Console。不出意外您的服务器将正常启动。
> 提示:看不见服务器启动的输出?检查服务器启动命令。
> 提示AkashicQQ 官方交流群433142833
7. 如果您有其它服务器,请重复此过程,为每个服务器配置 Prism Console。
## 安装 cqhttp(onebot) 协议实现程序 ## 安装 cqhttp(onebot) 协议实现程序
## 安装 AkashicQQ 本体 推荐安装 [go-cqhttp](https://docs.go-cqhttp.org/)。您也可以选用其它的 cqhttp(onebot) 协议实现程序。
请配置为反向 Websocket 通信方式,并在配置文件中填写机器人的 QQ 号、密码。
在 ws-reverse 配置项中,请将 universal 地址设置为 ws://{AkashicQQ 的 IP}:{AkashicQQ 的端口}/cqhttp/ws例如ws://127.0.0.1:4399/cqhttp/ws。
> 提示:安装遇到困难?请阅读 go-cqhttp 的[文档](https://docs.go-cqhttp.org/),也可在 AkashicQQ 官方交流群官方交流群433142833下载懒人包。
## 安装 AkashicQQ 本体
1. 完成以上准备后,我们可以开始 AkashicQQ 本体的安装了。您同样需要安装 Python 环境。如果您安装 AkashicQQ 的服务器与 Prism Console 相同,则不用再次安装。否则,您可能需要重复一遍安装 Python 环境的过程。
2. 通过[下载链接](https://hub.akashic.cc/Myth/AkashicQQ/archive/main.zip)下载 AkashicQQ。解压得到如下内容
<img src="_media/akashic-folder.png" width="30%">
3. 同样,将此目录在终端中打开。在命令行输入 `pip3 install -r requirements.txt` 安装依赖。
4. 请先查阅[配置文件](config)部分完成配置。
5. 在终端使用 `nb run` 运行 AkashicQQ。