feat: 图片本地化

This commit is contained in:
RockChinQ
2024-06-29 17:58:21 +08:00
parent e7d4318cff
commit 415a28318d
48 changed files with 45 additions and 96 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 691 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

-50
View File
@@ -1,50 +0,0 @@
---
head:
- - meta
- name: keywords
content: ChatGPT QQ机器人部署问题,QChatGPT项目部署问题
title: 问题解答
icon: blog
author: Lazy,ikun
date: 2023-10-28
category:
- 问题解答
---
> 之所以有问题解答这一页面,是因为很多人并不仔细阅读[功能介绍](./feature.md),以至于产生了一系列问题,为此又增设此页面来提供解决方案
:::info 目录
[[toc]]
## 目前所有的新号登录均会code:45,请不要在群里问了,谢谢
:::
## 项目配置文件如config.py文件双击打不开
:::tip 解答
config.py文件是一个python文件,需要相应的编辑器才能打开,很多情况下我们可以使用记事本打开
但是,我们**强烈建议下载一个代码编辑器**,这样能够极大地方便你对配置文件的修改
这里以VS Code为例,[下载地址](https://code.visualstudio.com/)
如果你还是不知道,可以网上搜一下,这里提供一个[B站视频](https://www.bilibili.com/video/BV1bK411P767/?spm_id_from=333.337.search-card.all.click&vd_source=b09c71fce8dcc714b307c12de388d2f4)
:::
## [bot]err:调用API失败,请重试或联系管理员,或等待修复
:::tip 解答
通常是由于你的API key没有正确填写,打开`QChatGPT\config.py`文件(使用记事本或代码编辑器),找到这一片代码,将你的API Key按照示例填写到对应地方
```python
openai_config = {
"api_key": {
"default": "sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
"http_proxy": None,
"reverse_proxy": None
}
```
> 本问题可见于[功能介绍的api-key的配置](./feature.md/#api-key的配置)
提示:如果你的API Key来自转发API,需在反向代理"reverse_proxy"中配置BASE_URL,通常为:https://管理地址/v1
:::
## [bot]person_ xxxxxxx会话调用API失败:Error communicating with OpenAI您的网络无法访问OpenAI接口或网络代理不正常
:::tip 解答
通常是由于你的网络环境所致,你需要使用全局代理或设置反代(推荐)
全局代理因你使用的代理软件而异,你应该了解的
设置反代,打开`QChatGPT\config.py`文件,按图配置:
` "reverse_proxy": "http://api.openai.lazyshare.top/v1"`
![反代设置.jpg](https://s2.loli.net/2023/08/16/GeoiZCbLtfg3uqH.jpg)
> 本问题可见于[功能介绍的反向代理的设置](./feature.md#反向代理的设置)
:::
@@ -38,11 +38,11 @@ Lagrange 是一个 QQNT 协议逆向工程框架,比 Shamrock 或 Mirai 更加
看图进行下载:
![图片1](https://cos.thelazy.cn/pictures/202405051146016.png)
![图片1](/assets/image/dl_lgr_1.png)
![图片2](https://cos.thelazy.cn/pictures/202405051146016.png)
![图片2](/assets/image/dl_lgr_2.png)
![图片3](https://cos.thelazy.cn/pictures/202405051151432.png)
![图片3](/assets/image/dl_lgr_3.png)
### 尾声
@@ -60,7 +60,7 @@ Lagrange 是一个 QQNT 协议逆向工程框架,比 Shamrock 或 Mirai 更加
需要配置 Lagrange 以让其连接上 QChatGPT,请编辑 Lagrange 的配置文件 appsettings.json,确保 Implementations 中的连接配置符合下图内容:
![Lagrange.OneBot的配置文件](https://cos.thelazy.cn/pictures/202405030020679.png)
![配置连接](/assets/image/config_lgr.png)
其中 Type 必须为 `ReverseWebSocket`;
Host 为 QChatGPT 运行的主机 IP,若在同一主机上,可以写 `127.0.0.1`;
@@ -28,12 +28,12 @@ NapCat 是一个 QQNT 协议逆向工程框架。
## NapCat配置教程
登录后,可以在config文件夹中,找到并修改文件(数字对应机器人QQ号):![image-20240514231529613](https://cos.thelazy.cn/pictures/image-20240514231529613.png)
登录后,可以在config文件夹中,找到并修改文件(数字对应机器人QQ号):![image-20240514231529613](/assets/image/napcat_cfg_1.png)
参考下图红框修改内容,确保地址中 IP地址 是 QChatGPT 运行的主机的地址(若在同一网络内运行则为 127.0.0.1),后缀须为`/ws`:
![image-20240514231932514](https://cos.thelazy.cn/pictures/202405142319592.png)
![image-20240514231932514](/assets/image/napcat_cfg_2.png)
然后重新运行登录即可,看到提示:
![image-20240514232647329](https://cos.thelazy.cn/pictures/202405142326384.png)
![image-20240514232647329](/assets/image/napcat_cfg_3.png)
@@ -40,9 +40,9 @@ Mirai、go-cqhttp 之类的是模拟 QQ 的协议进行通信,而 Shamrock 使
记得打开mumu模拟器的可写系统盘和root权限
![](https://cos.thelazy.cn/pictures/image-20240119153825389.png)
![](/assets/image/sham_env_1.png)
![image-20240119154032682](https://cos.thelazy.cn/pictures/202401191540727.png)
![image-20240119154032682](/assets/image/sham_env_2.png)
### 安装OpenShamrock
@@ -55,15 +55,15 @@ Mirai、go-cqhttp 之类的是模拟 QQ 的协议进行通信,而 Shamrock 使
启用被动 Websocket,并填写 QChatGPT 的 aiocqhttp 适配器监听的地址和端口(详见填写配置信息页)。
![img](https://cos.thelazy.cn/pictures/202402201959606.png)
![img](/assets/image/sham_cfg_1.png)
![img](https://cos.thelazy.cn/pictures/202402201959050.png)
![img](/assets/image/sham_cfg_2.png)
填写的被动 Websocket 地址为 QChatGPT 的 aiocqhttp 适配器监听的地址和端口,且路径必须为 `/ws`,例如 `ws://127.0.0.1:8080/ws`,详见填写配置信息页。
2. 并前往 LSPosed 的模块管理页面 启用模块 Shamrock
![image-20240119154110877](https://cos.thelazy.cn/pictures/202401191541922.png)
![image-20240119154110877](/assets/image/sham_cfg_3.png)
### 安装QQ
+5 -5
View File
@@ -24,7 +24,7 @@ gocq未归档,但官方表示:[https://github.com/Mrs4s/go-cqhttp/issues/247
从[go-cqhttp的Release](https://github.com/Mrs4s/go-cqhttp/releases/latest)下载最新的go-cqhttp可执行文件(建议直接下载可执行文件压缩包,而不是安装器)
![image-20231220210632911](https://cos.thelazy.cn/pictures/qchatgpt%E6%89%8B%E5%8A%A8%E9%83%A8%E7%BD%B2202312202106952.png)
![下载gocq](/assets/image/dl_gocq.png)
## 运行并配置go-cqhttp
@@ -105,17 +105,17 @@ default-middlewares: &default
双击登录脚本,一段时间后,可以看到提示
![image-20231220211135776](https://cos.thelazy.cn/pictures/qchatgpt%E6%89%8B%E5%8A%A8%E9%83%A8%E7%BD%B2202312202111807.png)
![登录gocq](/assets/image/first_launch.png)
把`Captcha link: `后边的链接复制下来,用Chrome或者Edge浏览器打开,按F12打开开发者工具
点开 `Network`
![img5](https://docs.mirai.mamoe.net/assets/img5.9c53babb.png)
![过验证码](/assets/image/get_captcha.png)
在浏览器中完成验证, 在 `Network` 中找到名为 `cap_union_new_verify` 的请求, 在最下面
![img6](https://docs.mirai.mamoe.net/assets/img6.2c4cf2d2.png)
![获取token](/assets/image/get_gocq_login_token.png)
ticket 后那一坨就是要输入回 mirai 的内容,但不包括首尾的双引号
@@ -127,7 +127,7 @@ ticket 后那一坨就是要输入回 mirai 的内容,但不包括首尾的双
把复制下来的东西,粘贴到运行go-cq的终端中
![image-20231220211712572](https://cos.thelazy.cn/pictures/qchatgpt%E6%89%8B%E5%8A%A8%E9%83%A8%E7%BD%B2202312202117600.png)
![粘贴token](/assets/image/paste_token.png)
> 若启动后登录不成功,请尝试根据[此文档](https://docs.go-cqhttp.org/guide/config.html#%E8%AE%BE%E5%A4%87%E4%BF%A1%E6%81%AF)修改`device.json`的协议编号。
+23 -24
View File
@@ -28,44 +28,43 @@ category:
在你的任意盘(D,E,F什么都都可以)里面新建一个文件夹(例如命名qqbot)
![image-20231218170220749](https://cos.thelazy.cn/pictures/qchatgpt%E6%89%8B%E5%8A%A8%E9%83%A8%E7%BD%B2202312181702794.png)
2. 创建子文件夹
双击进入刚刚创建的文件夹,分别新建两个文件夹(建议命名保持一致)
![image-20231218170346542](https://cos.thelazy.cn/pictures/qchatgpt%E6%89%8B%E5%8A%A8%E9%83%A8%E7%BD%B2202312181703568.png)
双击进入刚刚创建的文件夹,分别新建两个文件夹(建议命名保持一致):mirai、QChatGPT
## 安装 mirai-console
在 [mcl-installer 的 releases 页面](https://github.com/iTXTech/mcl-installer/releases)下载对应版本的安装包,找到最新的安装包,即有“Latest”标志的安装包,点击`show all 14 assets`,下载 mcl-installer-X.X.X-windows-amd64.exe,如图,则下载`mcl-installer-1.0.7-windows-amd64.exe`,保存在刚才创建的`mirai文件夹`中
![屏幕截图 2023-11-23 223909.png](https://cos.thelazy.cn/pictures/mirai-console%E7%9A%84%E6%95%99%E7%A8%8B202312181655031.png)
![屏幕截图 2023-11-23 223909.png](/assets/image/mirai_dl_1.png)
![image-20231218170548696](https://cos.thelazy.cn/pictures/qchatgpt%E6%89%8B%E5%8A%A8%E9%83%A8%E7%BD%B2202312181705727.png)
![image-20231218170548696](/assets/image/mirai_dl_2.png)
双击打开,一路回车。然后,你可以看到多出来一些文件。
![image-20231218170726759](https://cos.thelazy.cn/pictures/qchatgpt%E6%89%8B%E5%8A%A8%E9%83%A8%E7%BD%B2202312181707796.png)
![image-20231218170726759](/assets/image/mirai_dl_3.png)
继续点击`mcl.cmd`,看不到文件后缀的,参考这个文章来显示文件后缀名:[如何查看文件后缀](https://jingyan.baidu.com/article/9158e0004c6cbea2541228da.html)
双击后会显示如下图所示的类似界面,当出现`Enter to continue`时,表明你需要按回车健
![屏幕截图 2023-11-24 174015.png](https://cos.thelazy.cn/pictures/qchatgpt%E6%89%8B%E5%8A%A8%E9%83%A8%E7%BD%B2202312181714763.png)![屏幕截图 2023-11-24 174650.png](https://cos.thelazy.cn/pictures/qchatgpt%E6%89%8B%E5%8A%A8%E9%83%A8%E7%BD%B2202312181714650.png)
![屏幕截图 2023-11-24 174015.png](/assets/image/mirai_dl_4.png)
![屏幕截图 2023-11-24 174650.png](/assets/image/mirai_dl_5.png)
当出现上面的一行绿字时,说明安装完成,到这里输入 exit,回车退出
## 安装 mirai-api-http
打开 `mcl.cmd`,输入`mcl --update-package net.mamoe:mirai-api-http --channel stable-v2 --type plugin` ,回车
![image-20231218172022449](https://cos.thelazy.cn/pictures/qchatgpt%E6%89%8B%E5%8A%A8%E9%83%A8%E7%BD%B2202312181720470.png)再次打开`mcl.cmd`,一路回车,直至退出。
![image-20231218172022449](/assets/image/mah_dl_1.png)
再次打开`mcl.cmd`,一路回车,直至退出。
再打开 mcl.cmd,看到如以下界面,说明成功
![屏幕截图 2023-11-24 184618.png](https://cos.thelazy.cn/pictures/qchatgpt%E6%89%8B%E5%8A%A8%E9%83%A8%E7%BD%B2202312181719784.png)
![屏幕截图 2023-11-24 184618.png](/assets/image/mah_dl_2.png)
键盘按下`Ctrl+C`,退出。
找到mira/config/net.mamoe.mirai-api-http/setting.yml文件,右键用记事本打开
![image-20231218172354159](https://cos.thelazy.cn/pictures/qchatgpt%E6%89%8B%E5%8A%A8%E9%83%A8%E7%BD%B2202312181723195.png)
![image-20231218172354159](/assets/image/mah_dl_3.png)
把内容全部删掉,换成
@@ -85,40 +84,40 @@ adapterSettings:
```
再打开 `mcl.cmd`,可以看到输出
![image-20231218174112536](https://cos.thelazy.cn/pictures/qchatgpt%E6%89%8B%E5%8A%A8%E9%83%A8%E7%BD%B2202312181741769.png)
![image-20231218174112536](/assets/image/mah_dl_4.png)
则 mirai-api-http 安装成功。
## 配置签名服务
在这个链接下载qsign一键签名包,点击下载最新的那个zip压缩包,如下图的`qsign-1.2.1-beta-dev-d62ddce-all.zip`【写于2023年12月19日】,[点我跳转下载页面](https://github.com/MrXiaoM/qsign/releases)
![image-20231219211250617](https://cos.thelazy.cn/pictures/qchatgpt%E6%89%8B%E5%8A%A8%E9%83%A8%E7%BD%B2202312192112766.png)
![image-20231219211250617](/assets/image/mirai_sign_1.png)
下载完成后,解压得到如图文件
![image-20231219211634274](https://cos.thelazy.cn/pictures/qchatgpt%E6%89%8B%E5%8A%A8%E9%83%A8%E7%BD%B2202312192116299.png)
![image-20231219211634274](/assets/image/mirai_sign_2.png)
将两个文件复制到mirai文件夹中
![image-20231219211904375](https://cos.thelazy.cn/pictures/qchatgpt%E6%89%8B%E5%8A%A8%E9%83%A8%E7%BD%B2202312192119398.png)
![image-20231219211904375](/assets/image/mirai_sign_3.png)
打开`txlib`文件夹,发现有若干数字命名的文件夹,记录下最大的那个
![image-20231219212926059](https://cos.thelazy.cn/pictures/qchatgpt%E6%89%8B%E5%8A%A8%E9%83%A8%E7%BD%B2202312192129175.png)
![image-20231219212926059](/assets/image/mirai_sign_4.png)
然后,双击运行`mcl.cmd`,稍等一会儿后,当提示`mirai-console started successfully`时,qsign就安装上了
之后,打开`mirai/config/top.mrxiaom.qsign`下的`config.yml`文件,用记事本打开
![image-20231219213026138](https://cos.thelazy.cn/pictures/qchatgpt%E6%89%8B%E5%8A%A8%E9%83%A8%E7%BD%B2202312192130201.png)
![image-20231219213026138](/assets/image/mirai_sign_5.png)
![image-20231219213255993](https://cos.thelazy.cn/pictures/qchatgpt%E6%89%8B%E5%8A%A8%E9%83%A8%E7%BD%B2202312192132019.png)
![image-20231219213255993](/assets/image/mirai_sign_6.png)
然后,按下`Ctrl+S`保存
然后,再次双击运行`mcl.cmd`,可以看到类似提示,如图
![image-20231219214603122](https://cos.thelazy.cn/pictures/qchatgpt%E6%89%8B%E5%8A%A8%E9%83%A8%E7%BD%B2202312192146161.png)
![image-20231219214603122](/assets/image/mirai_sign_7.png)
## 运行mirai
@@ -132,17 +131,17 @@ login 12345 67890
然后,可以看到提示
![image-20231219215234389](https://cos.thelazy.cn/pictures/qchatgpt%E6%89%8B%E5%8A%A8%E9%83%A8%E7%BD%B2202312192152446.png)
![image-20231219215234389](/assets/image/run_mirai_1.png)
把`Captcha link: `后边的链接复制下来,用Chrome或者Edge浏览器打开,按F12打开开发者工具
点开 `Network`
![img5](https://docs.mirai.mamoe.net/assets/img5.9c53babb.png)
![img5](/assets/image/get_captcha.png)
在浏览器中完成验证, 在 `Network` 中找到名为 `cap_union_new_verify` 的请求, 在最下面
![img6](https://docs.mirai.mamoe.net/assets/img6.2c4cf2d2.png)
![img6](/assets/image/get_gocq_login_token.png)
ticket 后那一坨就是要输入回 mirai 的内容,但不包括首尾的双引号
@@ -154,7 +153,7 @@ ticket 后那一坨就是要输入回 mirai 的内容,但不包括首尾的双
把复制下来的东西,粘贴到运行mirai的终端中
![image-20231219220645708](https://cos.thelazy.cn/pictures/qchatgpt%E6%89%8B%E5%8A%A8%E9%83%A8%E7%BD%B2202312192206741.png)
![image-20231219220645708](/assets/image/paste_token.png)
然后回车,如果运气好的话,会提示你要收验证码,输入yes并回车,之后把验证码输入上去,然后回车即可成功登录了
@@ -16,11 +16,11 @@ date: 2023-12-18
翻到最下边,点击这个下载python安装器
![image-20231219213747065](https://cos.thelazy.cn/pictures/qchatgpt%E6%89%8B%E5%8A%A8%E9%83%A8%E7%BD%B2202312192137143.png)
![image-20231219213747065](/assets/image/python_1.png)
然后,双击打开你刚才下载的,记得勾选下面的
![image-20231219222341736](https://cos.thelazy.cn/pictures/qchatgpt%E6%89%8B%E5%8A%A8%E9%83%A8%E7%BD%B2202312192223809.png)
![image-20231219222341736](/assets/image/python_2.png)
然后,所有项保持默认即可
@@ -28,6 +28,6 @@ date: 2023-12-18
按win+R键,输入cmd,回车,在输入python,回车
![image-20231219222916951](https://cos.thelazy.cn/pictures/qchatgpt%E6%89%8B%E5%8A%A8%E9%83%A8%E7%BD%B2202312192229984.png)
![image-20231219222916951](/assets/image/python_3.png)
提示如图时,表明安装成功了
+2 -2
View File
@@ -120,7 +120,7 @@ category:
2. 发送消息给机器人,机器人即会自动回复
3. 可以通过`!help`查看帮助信息
![屏幕截图 1](https://cos.thelazy.cn/pictures/qchatgpt%E5%8A%9F%E8%83%BD%E4%BB%8B%E7%BB%8D202312201453499.png)
![私聊使用](/assets/image/private_chat.png)
#### 群聊使用
@@ -128,4 +128,4 @@ category:
2. at机器人并发送消息,机器人即会自动回复
3. at机器人并发送`!help`查看帮助信息
![屏幕截图 2](https://cos.thelazy.cn/pictures/qchatgpt%E5%8A%9F%E8%83%BD%E4%BB%8B%E7%BB%8D202312201454898.png)
![群聊使用](/assets/image/group_chat.png)