Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

命令管理和中间件优化处理 (Sourcery refactored) #1123

Open
wants to merge 146 commits into
base: browser-version-dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
146 commits
Select commit Hold shift + click to select a range
343fe85
fix: register exit hook
lss233 Apr 20, 2023
c075c03
optimize tts voice management.
lcjqyml Apr 20, 2023
1de66b8
shorter logs.
lcjqyml Apr 20, 2023
27ec9fd
apply suggestions
lss233 Apr 20, 2023
b8d6bee
'Refactored by Sourcery'
Apr 20, 2023
d70db25
fix: model switching not supported in async
lss233 Apr 8, 2023
daea380
fix: support all yiyan api
lss233 Apr 20, 2023
426c08e
fix: headers
lss233 Apr 20, 2023
de6ddc1
chore: improve error message on drawing failed
lss233 Apr 20, 2023
a054418
chore: rename variables
lss233 Apr 20, 2023
c3f64e4
fix: rollback web conversation id
lss233 Apr 20, 2023
48efc50
fix #669: sd default configuration
lss233 Apr 20, 2023
f1f6280
fix: parse_tts_voice not awaited
lss233 Apr 20, 2023
fcadd29
fix: parse_tts_voice not awaited
lss233 Apr 20, 2023
f92cda3
chore(edge-tts): clear logs
lss233 Apr 20, 2023
354d380
fix(yiyan): wrong check api url
lss233 Apr 20, 2023
b9e79c7
针对stable diffusion api有账号密码的情况做出相应完善
GTian28 Apr 22, 2023
757256c
fix(yiyan): setup headers on reset
lss233 Apr 22, 2023
318178b
fix(sdwebui): check authorization during init
lss233 Apr 22, 2023
8457671
chore(deps): bump edgegpt from 0.1.25.1 to 0.3.0
dependabot[bot] Apr 24, 2023
e7bbd7e
chore(deps): update poe-api requirement from ~=0.3.0 to ~=0.3.1
dependabot[bot] Apr 24, 2023
9c558ac
chore(deps): update pygments requirement from ~=2.15.0 to ~=2.15.1
dependabot[bot] Apr 24, 2023
b38996d
feat: support wecom
WangEdward Apr 25, 2023
d94d6ef
'Refactored by Sourcery'
Apr 25, 2023
eef702c
fix(bing): skip empty response
lss233 Apr 26, 2023
6abf721
fix(wecom): voice conversion
WangEdward Apr 26, 2023
24af9e2
fix(wecom): voice conversion codec
WangEdward Apr 26, 2023
64dfab9
chore(text_to_speech): annoying startup message
lss233 Apr 26, 2023
892cfbe
fix(onebot): unable getting image if mirai not configured
lss233 Apr 26, 2023
08d9207
fix: sometimes holder is missing
lss233 Apr 26, 2023
11e7a10
fix: raise error
lss233 Apr 26, 2023
7fdf3c1
feat(bing): support draw image from text prompt
lss233 Apr 26, 2023
1569f39
chore(bing): improve Redirect failed notice
lss233 Apr 26, 2023
39e60d9
chore(onebot): hide unnecessary log
lss233 Apr 27, 2023
c23681b
fix(universal): error handling failed if conversation not defined
lss233 Apr 27, 2023
6bf7f4f
feat: support claude in slack
lss233 Apr 28, 2023
706f79d
chore: handle network error
lss233 Apr 28, 2023
c7cc000
chore(deps): bump BingImageCreator to ~=0.1.3
lss233 Apr 28, 2023
e9dc5cb
fix(slack): increase read timeout
lss233 Apr 28, 2023
fcf0f8e
Merge branch 'browser-version' into browser-version
lss233 Apr 28, 2023
e45c2f6
Merge pull request #703 from WangEdward/browser-version
lss233 Apr 28, 2023
6c85d47
Fix http not returning mp3 when mirai and http are enabled at the sam…
lcjqyml Apr 28, 2023
dbb2d16
fix(constants): add wecom
lss233 Apr 28, 2023
cc1dc75
fix(baiducloud): check access token expiration
lss233 Apr 28, 2023
e3683da
Update README.md
lss233 Apr 28, 2023
1077b0b
chore(deps): update bingimagecreator requirement from ~=0.1.3 to ~=0.1.4
dependabot[bot] May 1, 2023
d81392c
chore(deps): bump edgegpt from 0.3.0 to 0.3.2
dependabot[bot] May 1, 2023
512e61e
Update README.md
lss233 May 4, 2023
2228c47
Update README.md
lss233 May 4, 2023
46400b6
fix ping response
Elijah-0616 May 4, 2023
898f489
更换镜像源以加快国内构建
Elijah-0616 May 4, 2023
9434af7
Fix 自动推测AI不支持slack-claude
Elijah-0616 May 5, 2023
55d155a
update:Use the new api to verify the id
Artrajz May 5, 2023
ddd3649
'Refactored by Sourcery'
May 5, 2023
a960e2d
Fix auto detect default ai
Elijah-0616 May 6, 2023
1d3d396
Update README.md
lss233 May 6, 2023
2c64305
Update README.md
lss233 May 6, 2023
97f9dcf
CI: 使用 go-cqhttp 的 Windows 快速部署包 (#770)
lss233 May 6, 2023
b0562ae
fix: add missing fields for slack-claude
lss233 Apr 29, 2023
c037708
chore(deps): bump EdgeGPT & BingImageCreator version
lss233 May 6, 2023
903688e
fix(chatgpt-api): reading default model from config
lss233 May 6, 2023
97727eb
fix(bing): improve cookie expire message
lss233 May 6, 2023
ff08547
ci(quickstart): rename
lss233 May 6, 2023
72373f0
fix(onebot): read qq from event.self_id
lss233 May 7, 2023
49189ea
Update README.md
lss233 May 9, 2023
3e7dbdd
Update requirements.txt
lss233 May 14, 2023
65ec720
chore(deps): bump python-telegram-bot from 20.2 to 20.3
dependabot[bot] May 15, 2023
e7849ce
chore(deps): bump graia-ariadne from 0.11.3 to 0.11.5
dependabot[bot] May 15, 2023
3b7a83b
fix(quickstart): set temporary env instead of permanent
lss233 May 16, 2023
9fec204
Update poe-claude100k,poe-gpt4,poe-neevaai
IceThunder May 16, 2023
7e40a0c
Update docker-compose.go-cqhttp.yaml
lss233 May 22, 2023
72b932e
修复图生图init_images字段为空的bug
FelixFeli May 23, 2023
4862152
Add config to fix conversation error. Reset conversation after timeout.
lcjqyml May 23, 2023
d436635
chore(deps): update openai requirement from ~=0.27.4 to ~=0.27.7
dependabot[bot] May 22, 2023
fd5feb2
doc: 提供一种新的部署思路,方式和一键部署脚本。 (#878)
B17w153 May 25, 2023
6008bf9
fix poe gpt 4
Cloxl May 30, 2023
6a854a2
poe:beaver→gpt4
Cloxl May 30, 2023
abbf451
feat-upgrade-poe-api
lss233 May 31, 2023
2fea9e3
chore(deps): update bingimagecreator requirement from ~=0.1.5 to ~=0.4.1
dependabot[bot] Jun 5, 2023
1eff396
chore(deps): update requests requirement from ~=2.28.2 to ~=2.31.0
dependabot[bot] May 29, 2023
0c1ffe9
chore(deps): bump edgegpt from 0.3.8.1 to 0.8.1
dependabot[bot] Jun 5, 2023
e0c5233
upgrade-poe-api
Elijah-0616 Jun 10, 2023
b303900
fix: bing drawing
lss233 Jun 10, 2023
cfcb8c3
feat: password login is back
lss233 Jun 10, 2023
3fa9fbb
fix: remaining time calcuation
lss233 Jun 10, 2023
471491f
chore(deps): bump revChatGPT to 6.1.4
lss233 Jun 10, 2023
157249a
fix: yiyan is working again
lss233 Jun 10, 2023
cccf004
feat: support xinghuo
lss233 Jun 10, 2023
9205c52
feat: allow bing to use preset
lss233 Jun 10, 2023
4b537e3
feat: check exp time before checking conversation
lss233 Jun 10, 2023
81d4874
fix(xinghuo): add geeError notice
lss233 Jun 10, 2023
558f08e
fix: update message of request too many
lss233 Jun 10, 2023
7c51626
chore(deps): bump OpenAIAuth to 1.0.2
lss233 Jun 10, 2023
da8a470
fix: remove unused logs
lss233 Jun 11, 2023
5b4b6ab
fix(bing): force locale
lss233 Jun 11, 2023
b9c2b8a
fix(xinghuo): add default GtToken
lss233 Jun 11, 2023
e8458d5
chore(deps): update aiocqhttp requirement from ~=1.4.3 to ~=1.4.4
dependabot[bot] Jun 12, 2023
83a6cd7
chore(deps): update pydantic requirement from ~=1.10.7 to ~=1.10.9
dependabot[bot] Jun 12, 2023
863c01c
chore(deps): update regex requirement from ~=2023.3.23 to ~=2023.6.3
dependabot[bot] Jun 12, 2023
217b463
update
canxin121 Jun 12, 2023
342e303
Add new 3.5 models released by OpenAI today [3.5-turbo-061, 3.5-turbo…
0x7c13 Jun 14, 2023
e220a14
Added new GPT4 models as well
0x7c13 Jun 14, 2023
907270b
Remove unwanted changes
0x7c13 Jun 14, 2023
28e42fc
Upgrade revChatGPT version to support new OpenAI models
0x7c13 Jun 16, 2023
4c7c103
chore(deps): bump revchatgpt from 6.3.2 to 6.3.3
dependabot[bot] Jun 19, 2023
4c05f7c
chore(deps): update tinydb requirement from ~=4.7.1 to ~=4.8.0
dependabot[bot] Jun 19, 2023
e6e9f59
chore(deps): update openai requirement from ~=0.27.7 to ~=0.27.8
dependabot[bot] Jun 19, 2023
71e9647
Fixes baiducloud bug and partial code formatting (Sourcery refactored…
sourcery-ai[bot] Jun 25, 2023
51abcb8
fix: 更新 Bard 脚本以正确获取数据
Huoyuuu Jul 5, 2023
fb32582
FIX:poe payload error
Elijah-0616 Jul 3, 2023
11081c4
fix: Error Download too many times
Elijah-0616 Jul 4, 2023
ec4dbee
重构流式API请求,加入会话压缩功能 (#1033)
Haibersut Jul 11, 2023
71730dc
修复程序开启http模式关不掉的问题 (#1040)
Haibersut Jul 11, 2023
62b3cff
修复重构API错误 (#1042)
Haibersut Jul 11, 2023
4124979
更新edgeGPT的方式和依赖版本 (#1041)
jerryliang122 Jul 11, 2023
63f7111
Revert "更新edgeGPT的方式和依赖版本 (#1041)" (#1044)
Haibersut Jul 12, 2023
101e406
不再强制检查API,新增非流API请求 (Sourcery refactored) (#1048)
sourcery-ai[bot] Jul 12, 2023
2f9da1d
Create quickstart-windows-dev-gocqhttp.yml
Haibersut Jul 12, 2023
9f8a4fd
优化部分代码 (#1058)
Haibersut Jul 16, 2023
f4de8e3
edgeGPT更新 (#1051)
jerryliang122 Jul 16, 2023
21f179e
chore(deps): update pydantic requirement from ~=1.10.9 to ~=2.0.2 (#1…
dependabot[bot] Jul 16, 2023
0c61443
chore(deps): update urllib3 requirement from ~=1.26.15 to ~=2.0.3 (#948)
dependabot[bot] Jul 16, 2023
0fb82e1
Update api.py
Haibersut Jul 17, 2023
2be1837
Update requirements.txt
Haibersut Jul 17, 2023
8ec1fa8
修改API响应格式 (Sourcery refactored) (#1066)
sourcery-ai[bot] Jul 17, 2023
8b752dc
chore(deps): bump revchatgpt from 6.3.3 to 6.8.1 (#1038)
dependabot[bot] Jul 21, 2023
3b993e6
chore(deps): update poe-api requirement from ~=0.4.8 to ~=0.4.10 (#1061)
dependabot[bot] Jul 21, 2023
7a7bc9f
增加异常请求提示 (#1077)
Haibersut Jul 21, 2023
ef33e8c
chore(deps): update poe-api requirement from ~=0.4.10 to ~=0.4.11 (#1…
dependabot[bot] Jul 21, 2023
413aca5
Update requirements.txt
Haibersut Jul 21, 2023
22004d7
Update bot.py
Jul 23, 2023
ab737f8
Update api.py
Jul 23, 2023
0b22e39
增加对私有化部署的支持,移除不必要的代码
Haibersut Jul 27, 2023
176a766
修复私有化模型导致的上下文失效
Haibersut Jul 28, 2023
7240afb
fix: old poe-api cause AttributeError (#1097)
qrzbing Jul 31, 2023
8288978
fix: remove binutils will also remove gcc (#1100)
qrzbing Jul 31, 2023
5a376b8
修复部分情况下上游返回正常的空消息导致程序错误 (#1101)
Haibersut Jul 31, 2023
52249b0
删除Poe已弃用的模型并添加几个新的Poe模型 (#1110)
EvolvedGhost Aug 3, 2023
eeb15c4
chore(deps): update httpcore requirement from ~=0.17.2 to ~=0.17.3 (#…
dependabot[bot] Aug 3, 2023
e414faf
chore(deps): update tinydb requirement from ~=4.7.1 to ~=4.8.0 (#1060)
dependabot[bot] Aug 3, 2023
e3fd826
chore(deps): bump python-telegram-bot from 20.3 to 20.4 (#1083)
dependabot[bot] Aug 3, 2023
320fc1f
chore(deps): update urllib3 requirement from ~=2.0.3 to ~=2.0.4 (#1084)
dependabot[bot] Aug 3, 2023
757eac9
chore(deps): update aiohttp requirement from ~=3.8.4 to ~=3.8.5 (#1085)
dependabot[bot] Aug 3, 2023
09f4d79
增加命令管理器和自动导入中间件方法
Haibersut Aug 5, 2023
4624ab9
'Refactored by Sourcery'
Aug 5, 2023
7d93c5b
Update command.py
Haibersut Aug 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/quickstarts/windows/config.example.go-cqhttp.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 这里是 ChatGPT for QQ 的所有配置文件
# 请注意:以 "#" 开头的文本均为注释
# 不会被程序读取
# 如果你想要使用某个设置,请确保前面没有 "#" 号

########################
# 配置文件编写教程:
# https://chatgpt-qq.lss233.com/
########################
[onebot]
manager_qq = 请修改为机器人管理员的QQ号(你本人的 QQ 号)

[openai]
# 如果你想添加 Claude、Bing 等 AI,请阅读【教程】

[[openai.accounts]]
access_token = "这里填写你的 access_token(其他接入方式请看教程)"
# 国内用户可能需要配置代理
# proxy="http://127.0.0.1:7890"

[presets]
# 切换预设的命令: 加载预设 猫娘
command = "加载预设 (\\w+)"

[presets.keywords]
# 预设关键词 <-> 实际文件
"聊天" = "presets/issue402.txt"
"猫娘" = "presets/catgirl.txt"
107 changes: 107 additions & 0 deletions .github/quickstarts/windows/go-cqhttp/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# go-cqhttp 默认配置文件

account: # 账号相关
uin: YOUR_BOT_QQ_HERE # QQ账号
password: '' # 密码为空时使用扫码登录
encrypt: false # 是否开启密码加密
status: 0 # 在线状态 请参考 https://docs.go-cqhttp.org/guide/config.html#在线状态
relogin: # 重连设置
delay: 3 # 首次重连延迟, 单位秒
interval: 3 # 重连间隔
max-times: 0 # 最大重连次数, 0为无限制

# 是否使用服务器下发的新地址进行重连
# 注意, 此设置可能导致在海外服务器上连接情况更差
use-sso-address: true
# 是否允许发送临时会话消息
allow-temp-session: false

heartbeat:
# 心跳频率, 单位秒
# -1 为关闭心跳
interval: 5

message:
# 上报数据类型
# 可选: string,array
post-format: string
# 是否忽略无效的CQ码, 如果为假将原样发送
ignore-invalid-cqcode: true
# 是否强制分片发送消息
# 分片发送将会带来更快的速度
# 但是兼容性会有些问题
force-fragment: false
# 是否将url分片发送
fix-url: false
# 下载图片等请求网络代理
proxy-rewrite: ''
# 是否上报自身消息
report-self-message: false
# 移除服务端的Reply附带的At
remove-reply-at: false
# 为Reply附加更多信息
extra-reply-data: false
# 跳过 Mime 扫描, 忽略错误数据
skip-mime-scan: false

output:
# 日志等级 trace,debug,info,warn,error
log-level: warn
# 日志时效 单位天. 超过这个时间之前的日志将会被自动删除. 设置为 0 表示永久保留.
log-aging: 15
# 是否在每次启动时强制创建全新的文件储存日志. 为 false 的情况下将会在上次启动时创建的日志文件续写
log-force-new: true
# 是否启用日志颜色
log-colorful: true
# 是否启用 DEBUG
debug: false # 开启调试模式

# 默认中间件锚点
default-middlewares: &default
# 访问密钥, 强烈推荐在公网的服务器设置
access-token: ''
# 事件过滤器文件目录
filter: ''
# API限速设置
# 该设置为全局生效
# 原 cqhttp 虽然启用了 rate_limit 后缀, 但是基本没插件适配
# 目前该限速设置为令牌桶算法, 请参考:
# https://baike.baidu.com/item/%E4%BB%A4%E7%89%8C%E6%A1%B6%E7%AE%97%E6%B3%95/6597000?fr=aladdin
rate-limit:
enabled: false # 是否启用限速
frequency: 1 # 令牌回复频率, 单位秒
bucket: 1 # 令牌桶大小

database: # 数据库相关设置
leveldb:
# 是否启用内置leveldb数据库
# 启用将会增加10-20MB的内存占用和一定的磁盘空间
# 关闭将无法使用 撤回 回复 get_msg 等上下文相关功能
enable: true
sqlite3:
# 是否启用内置sqlite3数据库
# 启用将会增加一定的内存占用和一定的磁盘空间
# 关闭将无法使用 撤回 回复 get_msg 等上下文相关功能
enable: false
cachettl: 3600000000000 # 1h

# 连接服务列表
servers:
# 添加方式,同一连接方式可添加多个,具体配置说明请查看文档
#- http: # http 通信
#- ws: # 正向 Websocket
#- ws-reverse: # 反向 Websocket
#- pprof: #性能分析服务器
# 反向WS设置
- ws-reverse:
# 反向WS Universal 地址
# 注意 设置了此项地址后下面两项将会被忽略
universal: ws://127.0.0.1:8566/ws
# 反向WS API 地址
api: ws://your_websocket_api.server
# 反向WS Event 地址
event: ws://your_websocket_event.server
# 重连间隔 单位毫秒
reconnect-interval: 3000
middlewares:
<<: *default # 引用默认中间件
1 change: 1 addition & 0 deletions .github/quickstarts/windows/go-cqhttp/device.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"display":"MIRAI.328126.001","product":"mirai","device":"mirai","board":"mirai","model":"mirai","finger_print":"mamoe/mirai/mirai:10/MIRAI.200122.001/9131310:user/release-keys","boot_id":"779066ef-140d-cf58-4b54-415b6db79071","proc_version":"Linux version 3.0.31-NAKD7gEP ([email protected])","protocol":2,"imei":"427816956058829","brand":"mamoe","bootloader":"unknown","base_band":"","version":{"incremental":"5891938","release":"10","codename":"REL","sdk":29},"sim_info":"T-Mobile","os_type":"android","mac_address":"00:50:56:C0:00:08","ip_address":[10,0,1,3],"wifi_bssid":"00:50:56:C0:00:08","wifi_ssid":"\u003cunknown ssid\u003e","imsi_md5":"cc73b4a6b592dcebb09db63419673a69","android_id":"1e52fc9af1b185eb","apn":"wifi","vendor_name":"MIUI","vendor_os_name":"mirai"}
68 changes: 68 additions & 0 deletions .github/quickstarts/windows/go-cqhttp/scripts/初始化.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
@ECHO OFF
@CHCP 65001
SET BASE_DIR=%cd%

ECHO !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ECHO !!
ECHO !! 如果您是新手,没有特殊需求。一路回车即可安装 !!!!
ECHO !! 如果您在执行的过程出现错误,可以重新启动此脚本 !!!!
ECHO !! 如果您遇到问题,可以提交 issue,或者在交流群询问 !!!!
ECHO !!
ECHO !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ECHO 当前的安装路径为 %BASE_DIR%
ECHO 提示:请注意安装路径中不要有空格,否则可能会导致安装失败
ECHO 提示:安装前先解压程序,不要在压缩包中直接运行
pause

cd "%BASE_DIR%\go-cqhttp"

cd "%BASE_DIR%"
ECHO 复制 配置信息...
set /p "bot_qq=请输入机器人QQ号:"
copy "%BASE_DIR%\files\go-cqhttp\config.yml" "%BASE_DIR%\go-cqhttp\"
copy "%BASE_DIR%\files\go-cqhttp\device.json" "%BASE_DIR%\go-cqhttp\"
setlocal enabledelayedexpansion
set "file=%BASE_DIR%\go-cqhttp\config.yml"
set "search=YOUR_BOT_QQ_HERE"
set "replace=!bot_qq!"
if exist "%file%" (
for /f "usebackq delims=" %%a in ("%file%") do (
set "line=%%a"
set "line=!line:%search%=%replace%!"
echo(!line!
)
) > "%file%.new"
move /y "%file%.new" "%file%" > nul
ECHO go-cqhttp 初始化完毕。
cd "%BASE_DIR%\chatgpt"

ECHO 接下来开始初始化 ChatGPT
ECHO 初始化 pip...
set PYTHON_EXECUTABLE="%BASE_DIR%\python3.11\python.exe"
cd "%BASE_DIR%\python3.11"
@REM %PYTHON_EXECUTABLE% get-pip.py

ECHO 安装依赖...
cd "%BASE_DIR%\chatgpt"

REM 如果下载的依赖不是最新版
REM 请修改 https://mirrors.aliyun.com/pypi/simple/ 为 https://pypi.org/simple/
REM 然后重新执行

%PYTHON_EXECUTABLE% -m pip install -i https://mirrors.aliyun.com/pypi/simple/ --extra-index-url https://pypi.org/simple/ -r requirements.txt

ECHO 接下来将会打开 config.cfg,请修改里面的信息。

cd "%BASE_DIR%\chatgpt"
COPY %BASE_DIR%\files\config.example.go-cqhttp.cfg config.cfg
notepad config.cfg
cd "%BASE_DIR%"

cls

COPY "%BASE_DIR%\files\go-cqhttp\scripts\启动ChatGPT.cmd" .
COPY "%BASE_DIR%\files\go-cqhttp\scripts\启动go-cqhttp.cmd" .
ECHO "接下来请先执行 【启动ChatGPT.cmd】,启动程序。"
ECHO "然后执行 【启动go-cqhttp.cmd】 并登录机器人 QQ,然后就可以开始使用了!"

pause
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
@ECHO OFF
@CHCP 65001

SET PATH="%cd%\ffmpeg\bin;%PATH%"

TITLE [ChatGPT for QQ] ChatGPT 端正在运行...
cd chatgpt && python3.11\python.exe bot.py
cd chatgpt && ..\python3.11\python.exe bot.py
TITLE [ChatGPT for QQ] ChatGPT 端已停止运行
ECHO 程序已停止运行。
PAUSE
12 changes: 12 additions & 0 deletions .github/quickstarts/windows/go-cqhttp/scripts/启动go-cqhttp.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@ECHO OFF
@CHCP 65001

TITLE [ChatGPT for QQ] go-cqhttp 端正在运行...

SET PATH="%cd%\ffmpeg\bin;%PATH%"

cd go-cqhttp && go-cqhttp -faststart
TITLE [ChatGPT for QQ] go-cqhttp 端已停止运行

echo 程序已停止运行
PAUSE
Original file line number Diff line number Diff line change
@@ -1,70 +1,70 @@
@ECHO OFF
@CHCP 65001
SET BASE_DIR=%cd%
ECHO 正在初始化 Mirai...
ECHO !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ECHO !!
ECHO !! 如果您是新手,没有特殊需求。一路回车即可安装 !!!!
ECHO !! 如果您在执行的过程出现错误,可以重新启动此脚本 !!!!
ECHO !! 如果您遇到问题,可以提交 issue,或者在交流群询问 !!!!
ECHO !!
ECHO !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ECHO 当前的安装路径为 %BASE_DIR%
ECHO 提示:请注意安装路径中不要有空格,否则可能会导致安装失败
ECHO 提示:安装前先解压程序,不要在压缩包中直接运行
pause
cd "%BASE_DIR%\mirai"
@REM mcl-installer.exe
@REM ECHO 安装 mirai-api-http 插件...
@REM ECHO 插件介绍:https://github.com/project-mirai/mirai-api-http
@REM cmd /c mcl.cmd --update-package net.mamoe:mirai-api-http --channel stable-v2 --type plugin
@REM
@REM ECHO 安装 mirai-device-generator 插件...
@REM ECHO 插件介绍:https://github.com/cssxsh/mirai-device-generator
@REM cmd /c mcl.cmd --update-package xyz.cssxsh.mirai:mirai-device-generator --channel stable --type plugin
@REM
@REM ECHO 安装 fix-protocol-version 插件...
@REM ECHO 插件介绍:https://github.com/cssxsh/fix-protocol-version
@REM cmd /c mcl.cmd --update-package xyz.cssxsh.mirai:fix-protocol-version --channel stable --type plugin
cd "%BASE_DIR%"
ECHO 复制 mirai-http-api 配置信息...
mkdir "%BASE_DIR%\mirai\config\net.mamoe.mirai-api-http"
copy "%BASE_DIR%\files\mirai-http-api-settings.yml" "%BASE_DIR%\mirai\config\net.mamoe.mirai-api-http\setting.yml"
ECHO Mirai 初始化完毕。
cd "%BASE_DIR%\chatgpt"
ECHO 接下来开始初始化 ChatGPT
ECHO 初始化 pip...
set PYTHON_EXECUTABLE="%cd%\python3.11\python.exe"
cd "%BASE_DIR%\chatgpt\python3.11"
@REM %PYTHON_EXECUTABLE% get-pip.py
ECHO 安装依赖...
cd "%BASE_DIR%\chatgpt"
REM 如果下载的依赖不是最新版
REM 请修改 https://mirrors.aliyun.com/pypi/simple/ 为 https://pypi.org/simple/
REM 然后重新执行
%PYTHON_EXECUTABLE% -m pip install -i https://mirrors.aliyun.com/pypi/simple/ --extra-index-url https://pypi.org/simple/ -r requirements.txt
ECHO 接下来将会打开 config.cfg,请修改里面的信息。
cd "%BASE_DIR%\chatgpt"
COPY config.example.cfg config.cfg
notepad config.cfg
cd "%BASE_DIR%"
cls
COPY "%BASE_DIR%\files\scripts\启动ChatGPT.cmd" .
COPY "%BASE_DIR%\files\scripts\启动Mirai.cmd" .
ECHO "接下来请先执行 【启动ChatGPT.cmd】,启动程序。"
ECHO "然后执行 【启动Mirai.cmd】 并登录机器人 QQ,然后就可以开始使用了!"
pause
@ECHO OFF
@CHCP 65001
SET BASE_DIR=%cd%

ECHO 正在初始化 Mirai...
ECHO !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ECHO !!
ECHO !! 如果您是新手,没有特殊需求。一路回车即可安装 !!!!
ECHO !! 如果您在执行的过程出现错误,可以重新启动此脚本 !!!!
ECHO !! 如果您遇到问题,可以提交 issue,或者在交流群询问 !!!!
ECHO !!
ECHO !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ECHO 当前的安装路径为 %BASE_DIR%
ECHO 提示:请注意安装路径中不要有空格,否则可能会导致安装失败
ECHO 提示:安装前先解压程序,不要在压缩包中直接运行
pause

cd "%BASE_DIR%\mirai"
@REM mcl-installer.exe

@REM ECHO 安装 mirai-api-http 插件...
@REM ECHO 插件介绍:https://github.com/project-mirai/mirai-api-http
@REM cmd /c mcl.cmd --update-package net.mamoe:mirai-api-http --channel stable-v2 --type plugin
@REM
@REM ECHO 安装 mirai-device-generator 插件...
@REM ECHO 插件介绍:https://github.com/cssxsh/mirai-device-generator
@REM cmd /c mcl.cmd --update-package xyz.cssxsh.mirai:mirai-device-generator --channel stable --type plugin
@REM
@REM ECHO 安装 fix-protocol-version 插件...
@REM ECHO 插件介绍:https://github.com/cssxsh/fix-protocol-version
@REM cmd /c mcl.cmd --update-package xyz.cssxsh.mirai:fix-protocol-version --channel stable --type plugin

cd "%BASE_DIR%"
ECHO 复制 mirai-http-api 配置信息...
mkdir "%BASE_DIR%\mirai\config\net.mamoe.mirai-api-http"
copy "%BASE_DIR%\files\mirai-http-api-settings.yml" "%BASE_DIR%\mirai\config\net.mamoe.mirai-api-http\setting.yml"

ECHO Mirai 初始化完毕。
cd "%BASE_DIR%\chatgpt"

ECHO 接下来开始初始化 ChatGPT
ECHO 初始化 pip...
set PYTHON_EXECUTABLE="%BASE_DIR%\python3.11\python.exe"
cd "%BASE_DIR%\python3.11"
@REM %PYTHON_EXECUTABLE% get-pip.py

ECHO 安装依赖...
cd "%BASE_DIR%\chatgpt"

REM 如果下载的依赖不是最新版
REM 请修改 https://mirrors.aliyun.com/pypi/simple/ 为 https://pypi.org/simple/
REM 然后重新执行

%PYTHON_EXECUTABLE% -m pip install -i https://mirrors.aliyun.com/pypi/simple/ --extra-index-url https://pypi.org/simple/ -r requirements.txt

ECHO 接下来将会打开 config.cfg,请修改里面的信息。

cd "%BASE_DIR%\chatgpt"
COPY config.example.cfg config.cfg
notepad config.cfg
cd "%BASE_DIR%"

cls

COPY "%BASE_DIR%\files\mirai\scripts\启动ChatGPT.cmd" .
COPY "%BASE_DIR%\files\mirai\scripts\启动Mirai.cmd" .
ECHO "接下来请先执行 【启动ChatGPT.cmd】,启动程序。"
ECHO "然后执行 【启动Mirai.cmd】 并登录机器人 QQ,然后就可以开始使用了!"

pause
11 changes: 11 additions & 0 deletions .github/quickstarts/windows/mirai/scripts/启动ChatGPT.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@ECHO OFF
@CHCP 65001

TITLE [ChatGPT for QQ] ChatGPT 端正在运行...

SET PATH="%cd%\ffmpeg\bin;%PATH%"

cd chatgpt && ..\python3.11\python.exe bot.py
TITLE [ChatGPT for QQ] ChatGPT 端已停止运行
ECHO 程序已停止运行。
PAUSE
Loading