A plugin to run go-cqhttp directly in NoneBot2, without additional download and installation.
Project description
nonebot-plugin-gocqhttp
A plugin to run go-cqhttp directly in NoneBot2, without additional download and installation.
一款在 NoneBot2 中直接运行 go-cqhttp 的插件, 无需额外下载安装.
优势
对标koishijs/koishi-plugin-gocqhttp
便于部署: 部署时只需启动一个 Bot 进程即可, 无需其他附加工具
易于使用: 本插件提供一个简单的 WebUI, 可以直接在图形界面中添加账户:
添加帐号 | 控制进程 |
查看状态 |
还有更多... 如果你觉得这个插件很赞, 欢迎返图! |
跨平台支持: 根据反馈, 本插件已可以在MacOS
/Linux
/Windows
上运行, 且不受异步子进程调用带来的限制
使用
安装
要求最低 Python 版本为 3.8
配置
本项目提供以下可选配置项, 请在.env
中自行进行配置
如果想要获取更多配置文件相关信息, 请阅读源代码
账号配置
GOCQ_ACCOUNTS
: 要登录的 QQ 账号列表, 为一个 json 数组
-
支持的字段:
uin
: QQ 账号 (必填)password
: QQ 密码, 不填将使用扫码登录protocol
: 数字, 是登录使用的客户端协议
-
示例:
[ { "uin": "QQ帐号", "password": "密码" } ]
下载地址配置
GOCQ_URL
: 下载 URL, 默认为空, 设置该项目后以下几个与下载有关的配置项目将失效
GOCQ_DOWNLOAD_DOMAINS
: 下载域名列表, 会从中选取延迟最低的进行下载
-
默认值
[ "download.fastgit.org", # Download mirror provided by FastGit "ghdown.obfs.dev", # Download mirror over Cloudflare worker "github.com", # Official GitHub download ]
GOCQ_REPO
: 要下载的仓库, 默认为Mrs4s/gocqhttp
GOCQ_VERSION
: 要下载的版本, 默认为空, 即下载最新版本
GOCQ_FORCE_DOWNLOAD
: 强制在启动时下载, 默认为 false
其他配置
GOCQ_PROCESS_KWARGS
: 创建进程时的可选参数, 请参照代码进行修改
GOCQ_WEBUI_USERNAME
/GOCQ_WEBUI_PASSWORD
: WebUI 的登录凭证, 不设置即不进行验证
开始使用
配置好了以后启动你的 Bot 即可
-
需要注意以下几点:
-
本插件会在 Bot 工作目录下创建
accounts
文件夹用于存储go-cqhttp
的二进制和账户数据文件, 如果你使用版本管理工具(如git
), 请自行将该文件夹加入忽略列表 -
本插件通过子进程调用实现, 如果你在外部通过手段强行终止了 Bot 进程, 请检查开启的子进程是否也同样已终止
-
如果你的 Bot 监听来自所有主机的连接(比如监听了
0.0.0.0
), 或者它向公网开放, 强烈建议设置 WebUI 登录凭证以防止被未授权访问
-
-
本插件提供了一个仅
SUPERUSERS
能使用的命令:gocq
, 可以用来查看当前运行的go-cqhttp
进程状态
鸣谢
koishijs/koishi-plugin-gocqhttp
: 本项目直接参考(直接开抄)Mrs4s/gocqhttp
,nonebot/nonebot2
:(看看项目名, 什么成分不用多说了吧)本项目的套壳的核心
贡献者们
感谢这些大佬对本项目作出的贡献:
Well404 🐛 |
pthmz 📖 |
SK 🐛 |
MistEO 🐛 💡 |
本段符合 all-contributors 规范
开源许可证
由于go-cqhttp
使用了AGPL-3.0许可证, 本项目也同样使用该许可
注意! 如果在您的项目中依赖了该插件, 您的项目必须以该许可开源!
A plugin to run go-cqhttp directly in NoneBot2, without additional download and installation.
Copyright (C) 2022 Mix
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for nonebot-plugin-gocqhttp-0.5.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6160d44dba6cfd0f47219cfb4bb9c08664fef5c3d776132ccada98c2616f84f |
|
MD5 | 1d6a356b72d038b4e14ca627748c38d8 |
|
BLAKE2b-256 | 4fa209172ca70916ffb088a086a7429a11721b6024302a4dbe36f761c611504e |
Hashes for nonebot_plugin_gocqhttp-0.5.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b878cf20264470a814fb162fd361eac1486bdd737d6f03bb50051205e55517a |
|
MD5 | ff1401e050d8bc146590fb5305ec8970 |
|
BLAKE2b-256 | a3627a2420982de7557a0379c5b416acf8ed61cd445fe4ceaee8fe89eb33c7a1 |