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的插件, 无需额外下载安装.
为什么?
-
为了不用同时手动启动
go-cqhttp
和nonebot
进程, 非常方便 -
为了便于Docker等进行部署, 只需制作一个
nonebot
容器即可
怎么用?
安装
推荐使用nb-cli
进行安装
配置
本项目提供以下配置项, 请在.env
中自行进行配置
如果想要获取更多配置文件相关信息, 请阅读源代码
-
ACCOUNTS
: 要登录的QQ账号列表, 为一个json数组-
支持的字段:
uin
: QQ账号 (必填)password
: QQ密码, 不填将使用扫码登录protocol
: 数字, 是登录使用的客户端协议config_extra
: 配置文件拓展, 用于覆盖默认配置- 由于在每次程序启动时
go-cqhttp
启动配置文件都会被覆盖, 所以请在该项目中设置你要添加的配置项- 当直接填写json对象时, 原样传入并更新配置文件
- 当传入以
ref:
开头的字符串时, 它将尝试读取之后目录中的文件, 来更改配置文件 - 当传入以
override:
开头的字符串时, 它将尝试尝试读取之后目录中的文件, 来覆盖配置文件
- 由于在每次程序启动时
device_extra
: 和config_extra
类似, 但是是用来覆盖device.json
中配置的
-
示例:
[ { "uin":"QQ帐号", "password":"密码", } ]
-
-
DOWNLOAD_REPO
: 要下载的仓库, 默认为Mrs4s/gocqhttp
-
DOWNLOAD_VERSION
: 要下载的版本, 默认为latest
, 即最新版本 -
DOWNLOAD_URL
: 下载URL, 支持多个占位符 -
FORCE_DOWNLOAD
: 强制在启动时下载, 默认为false
-
PROCESS_RESTARTS
: 尝试重启进程的次数, 小于0则不限制, 默认为-1
使用
配置好了以后启动你的Bot即可
- 需要注意以下几点:
- 本插件会在工作目录下创建
accounts
文件夹用于存储go-cqhttp
的二进制和数据文件, 如果你使用版本管理工具(如git
), 请自行将该文件夹加入忽略列表 - 本插件通过子进程调用实现, 如果你在外部终止了Bot进程, 请检查开启的子进程是否也同样已终止
- 本插件会在工作目录下创建
本插件提供了一个仅SUPERUSERS
能用的命令: gocq
, 可以用来查看当前运行的go-cqhttp
进程状态
鸣谢
koishijs/koishi-plugin-gocqhttp
: 本项目直接参考(直接开抄)Mrs4s/gocqhttp
,nonebot/nonebot2
:(看看项目名, 什么成分不用多说了吧)本项目的套壳的核心
开源许可证
由于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.3.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2343bf9f2615df3a84733942762faa29c90577f146d7460b64a84fcbdf2709ff |
|
MD5 | e20f6eae562c47d96205d51589fa21fb |
|
BLAKE2b-256 | 099211b07d767ff3277c0ade5e772f508f4a6d01cd605eaba43215c0e0e4a77d |
Hashes for nonebot_plugin_gocqhttp-0.3.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0896b4a5adbb705f89ad108087b9433da945c7877b4c23154367d56da04decc0 |
|
MD5 | 499911f1fb8f0aac5e6abe84722d498f |
|
BLAKE2b-256 | 644d56b299fcb1fd0e34120722f285017fd63c4748033d2f7acbb0bc27a9efcb |