Skip to main content

nonebot-plugin-guild-patch

Patch plugin for NoneBot2 QQ guild (go-cqhttp) support.

NoneBot2 QQ 频道 (go-cqhttp) 支持适配补丁插件.

PyPI

GitHub issues GitHub forks GitHub stars GitHub license

注: 本补丁没有经过充分测试, 不建议在生产环境使用, 如果发现任何问题请Issue 反馈

适用版本

  • go-cqhttp >= 1.0.0-beta8-fix2
  • NoneBot2 >= 2.0.0b1

支持功能

  • 正常接收并处理频道消息事件
    • 支持字符串形式消息上报
    • 支持数组形式消息上报
  • 支持bot.send和matcher.send直接向频道发送消息
  • 支持event.to_me以支持to_me规则
  • 可选的事件转换器, 将频道消息事件转换为群消息

安装

使用nb-cli或者其他什么你喜欢的方式安装并加载该插件即可

如果它被成功加载, 你在调试模式下应该看到这样的日志:

11-13 09:14:52 [DEBUG] nonebot | Succeeded to load adapter "onebot"
11-13 09:14:52 [SUCCESS] nonebot | Succeeded to import "nonebot.plugins.echo"
+ 11-13 09:14:52 [SUCCESS] nonebot | Succeeded to import "nonebot_plugin_guild_patch"
11-13 09:14:52 [SUCCESS] nonebot | Running NoneBot...
11-13 09:14:52 [DEBUG] nonebot | Loaded adapters: cqhttp
11-13 09:14:52 [INFO] uvicorn | Started server process [114514]
11-13 09:14:52 [INFO] uvicorn | Waiting for application startup.
11-13 09:14:52 [INFO] uvicorn | Application startup complete.

使用

这里有一个示例插件, 它只会接收来自频道的消息

from nonebot.plugin import on_command
from nonebot.adapters.onebot import Bot, MessageSegment

from nonebot_plugin_guild_patch import GuildMessageEvent

matcher = on_command('image')


@matcher.handle()
async def _(bot: Bot, event: GuildMessageEvent):
    await matcher.send(
        MessageSegment.image(
            file='https://1mg.obfs.dev/',
            cache=False,
        ))

开源许可

本项目使用MIT许可证开源

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Metadata

Release files for nonebot-plugin-guild-patch-remix 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nonebot-plugin-guild-patch-remix 0.2.4
File Size Uploaded Provenance Actions
nonebot_plugin_guild_patch_remix-0.2.4.tar.gz 5.7 kB Without provenance Details for nonebot_plugin_guild_patch_remix-0.2.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nonebot-plugin-guild-patch-remix 0.2.4
File Interpreter ABI Platform Actions
nonebot_plugin_guild_patch_remix-0.2.4-py3-none-any.whl Python 3 none any Details for nonebot_plugin_guild_patch_remix-0.2.4-py3-none-any.whl

Total release size: 13.2 kB

Release files / nonebot_plugin_guild_patch_remix-0.2.4.tar.gz

Download URL nonebot_plugin_guild_patch_remix-0.2.4.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b4846f8671814d501a8d966dd15f2e5c01ab1b1d1bcc5fa24fe6e71c2cdb6edd
BLAKE2b-256 checksum
How to use checksums
4343a6f8464bfae4c1253981e47df265bdaea1b668cd895b16ede25c3df05f82
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.9.19 Linux/6.5.0-1016-azure

Release files / nonebot_plugin_guild_patch_remix-0.2.4-py3-none-any.whl

Download URL nonebot_plugin_guild_patch_remix-0.2.4-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5440d799497aed90c58b2f7a5fa3d59352f46c63badad0ad150ec42955bda8c6
BLAKE2b-256 checksum
How to use checksums
a99da9242494868e91e3308b45417f3855b5b61f488c509c3b6ebadd193f5f81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.9.19 Linux/6.5.0-1016-azure

Security for nonebot-plugin-guild-patch-remix 0.2.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.4 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page