nonebot-plugin-guild-patch


Namenonebot-plugin-guild-patch JSON
Version 0.2.2 PyPI version JSON
download
home_pagehttps://github.com/mnixry/nonebot-plugin-guild-patch
SummaryPatch plugin for NoneBot2 QQ guild (go-cqhttp) support.
upload_time2022-12-30 07:55:42
maintainer
docs_urlNone
authorMix
requires_python>=3.7.3,<4.0.0
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # nonebot-plugin-guild-patch

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

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

![PyPI](https://img.shields.io/pypi/v/nonebot-plugin-guild-patch?style=for-the-badge)

[![GitHub issues](https://img.shields.io/github/issues/mnixry/nonebot-plugin-guild-patch)](https://github.com/mnixry/nonebot-plugin-guild-patch/issues)
[![GitHub forks](https://img.shields.io/github/forks/mnixry/nonebot-plugin-guild-patch)](https://github.com/mnixry/nonebot-plugin-guild-patch/network)
[![GitHub stars](https://img.shields.io/github/stars/mnixry/nonebot-plugin-guild-patch)](https://github.com/mnixry/nonebot-plugin-guild-patch/stargazers)
[![GitHub license](https://img.shields.io/github/license/mnixry/nonebot-plugin-guild-patch)](https://github.com/mnixry/nonebot-plugin-guild-patch/blob/main/LICENSE)

> **注: 本补丁没有经过充分测试, 不建议在生产环境使用, 如果发现任何问题请[Issue 反馈](https://github.com/mnixry/nonebot-plugin-guild-patch/issues/new/choose)**

## 适用版本

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

## 支持功能

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

## 安装

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

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

```diff
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.
```

## 使用

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

```python
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](./LICENSE)许可证开源

    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.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/mnixry/nonebot-plugin-guild-patch",
    "name": "nonebot-plugin-guild-patch",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7.3,<4.0.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "Mix",
    "author_email": "mnixry@users.noreply.github.com",
    "download_url": "https://files.pythonhosted.org/packages/83/c9/70df757d3ead68aaa539fcb3890d8e45ee1cd8c2b8153f7b08cbfce7f823/nonebot_plugin_guild_patch-0.2.2.tar.gz",
    "platform": null,
    "description": "# nonebot-plugin-guild-patch\n\n_Patch plugin for NoneBot2 QQ guild (go-cqhttp) support._\n\n_NoneBot2 QQ \u9891\u9053 (go-cqhttp) \u652f\u6301\u9002\u914d\u8865\u4e01\u63d2\u4ef6._\n\n![PyPI](https://img.shields.io/pypi/v/nonebot-plugin-guild-patch?style=for-the-badge)\n\n[![GitHub issues](https://img.shields.io/github/issues/mnixry/nonebot-plugin-guild-patch)](https://github.com/mnixry/nonebot-plugin-guild-patch/issues)\n[![GitHub forks](https://img.shields.io/github/forks/mnixry/nonebot-plugin-guild-patch)](https://github.com/mnixry/nonebot-plugin-guild-patch/network)\n[![GitHub stars](https://img.shields.io/github/stars/mnixry/nonebot-plugin-guild-patch)](https://github.com/mnixry/nonebot-plugin-guild-patch/stargazers)\n[![GitHub license](https://img.shields.io/github/license/mnixry/nonebot-plugin-guild-patch)](https://github.com/mnixry/nonebot-plugin-guild-patch/blob/main/LICENSE)\n\n> **\u6ce8: \u672c\u8865\u4e01\u6ca1\u6709\u7ecf\u8fc7\u5145\u5206\u6d4b\u8bd5, \u4e0d\u5efa\u8bae\u5728\u751f\u4ea7\u73af\u5883\u4f7f\u7528, \u5982\u679c\u53d1\u73b0\u4efb\u4f55\u95ee\u9898\u8bf7[Issue \u53cd\u9988](https://github.com/mnixry/nonebot-plugin-guild-patch/issues/new/choose)**\n\n## \u9002\u7528\u7248\u672c\n\n- `go-cqhttp` >= `1.0.0-beta8-fix2`\n- `NoneBot2` >= `2.0.0b1`\n\n## \u652f\u6301\u529f\u80fd\n\n- [x] \u6b63\u5e38\u63a5\u6536\u5e76\u5904\u7406\u9891\u9053\u6d88\u606f\u4e8b\u4ef6\n  - [x] \u652f\u6301\u5b57\u7b26\u4e32\u5f62\u5f0f\u6d88\u606f\u4e0a\u62a5\n  - [x] \u652f\u6301\u6570\u7ec4\u5f62\u5f0f\u6d88\u606f\u4e0a\u62a5\n- [x] \u652f\u6301`bot.send`\u548c`matcher.send`\u76f4\u63a5\u5411\u9891\u9053\u53d1\u9001\u6d88\u606f\n- [x] \u652f\u6301`event.to_me`\u4ee5\u652f\u6301`to_me`\u89c4\u5219\n- [ ] \u53ef\u9009\u7684\u4e8b\u4ef6\u8f6c\u6362\u5668, \u5c06\u9891\u9053\u6d88\u606f\u4e8b\u4ef6\u8f6c\u6362\u4e3a\u7fa4\u6d88\u606f\n\n## \u5b89\u88c5\n\n\u4f7f\u7528`nb-cli`\u6216\u8005\u5176\u4ed6\u4ec0\u4e48\u4f60\u559c\u6b22\u7684\u65b9\u5f0f\u5b89\u88c5\u5e76\u52a0\u8f7d\u8be5\u63d2\u4ef6\u5373\u53ef\n\n\u5982\u679c\u5b83\u88ab\u6210\u529f\u52a0\u8f7d, \u4f60\u5728\u8c03\u8bd5\u6a21\u5f0f\u4e0b\u5e94\u8be5\u770b\u5230\u8fd9\u6837\u7684\u65e5\u5fd7:\n\n```diff\n11-13 09:14:52 [DEBUG] nonebot | Succeeded to load adapter \"onebot\"\n11-13 09:14:52 [SUCCESS] nonebot | Succeeded to import \"nonebot.plugins.echo\"\n+ 11-13 09:14:52 [SUCCESS] nonebot | Succeeded to import \"nonebot_plugin_guild_patch\"\n11-13 09:14:52 [SUCCESS] nonebot | Running NoneBot...\n11-13 09:14:52 [DEBUG] nonebot | Loaded adapters: cqhttp\n11-13 09:14:52 [INFO] uvicorn | Started server process [114514]\n11-13 09:14:52 [INFO] uvicorn | Waiting for application startup.\n11-13 09:14:52 [INFO] uvicorn | Application startup complete.\n```\n\n## \u4f7f\u7528\n\n\u8fd9\u91cc\u6709\u4e00\u4e2a\u793a\u4f8b\u63d2\u4ef6, \u5b83\u53ea\u4f1a\u63a5\u6536\u6765\u81ea\u9891\u9053\u7684\u6d88\u606f\n\n```python\nfrom nonebot.plugin import on_command\nfrom nonebot.adapters.onebot import Bot, MessageSegment\n\nfrom nonebot_plugin_guild_patch import GuildMessageEvent\n\nmatcher = on_command('image')\n\n\n@matcher.handle()\nasync def _(bot: Bot, event: GuildMessageEvent):\n    await matcher.send(\n        MessageSegment.image(\n            file='https://1mg.obfs.dev/',\n            cache=False,\n        ))\n```\n\n## \u5f00\u6e90\u8bb8\u53ef\n\n\u672c\u9879\u76ee\u4f7f\u7528[MIT](./LICENSE)\u8bb8\u53ef\u8bc1\u5f00\u6e90\n\n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n    SOFTWARE.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Patch plugin for NoneBot2 QQ guild (go-cqhttp) support.",
    "version": "0.2.2",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "e428399448c74d3afc1207b827f36dcf",
                "sha256": "63e85e0528519d33752e59630d814af5959ec7d577b50271f4f682354918b6e3"
            },
            "downloads": -1,
            "filename": "nonebot_plugin_guild_patch-0.2.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e428399448c74d3afc1207b827f36dcf",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7.3,<4.0.0",
            "size": 7187,
            "upload_time": "2022-12-30T07:55:41",
            "upload_time_iso_8601": "2022-12-30T07:55:41.191401Z",
            "url": "https://files.pythonhosted.org/packages/5b/41/54277c20dc206ae27d014f43ec816aaf97d03bb8b585d359acffbf09b3f3/nonebot_plugin_guild_patch-0.2.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "82fd0a1ecaf540c6bba522acef2466bd",
                "sha256": "9bbbb6e519ce713ad462d014247c7d7a6ed9beeffff1752842ecebc9fb7ef52d"
            },
            "downloads": -1,
            "filename": "nonebot_plugin_guild_patch-0.2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "82fd0a1ecaf540c6bba522acef2466bd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7.3,<4.0.0",
            "size": 6267,
            "upload_time": "2022-12-30T07:55:42",
            "upload_time_iso_8601": "2022-12-30T07:55:42.931486Z",
            "url": "https://files.pythonhosted.org/packages/83/c9/70df757d3ead68aaa539fcb3890d8e45ee1cd8c2b8153f7b08cbfce7f823/nonebot_plugin_guild_patch-0.2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-30 07:55:42",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "mnixry",
    "github_project": "nonebot-plugin-guild-patch",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "nonebot-plugin-guild-patch"
}
        
Mix
Elapsed time: 0.02381s