Name | nonebot-plugin-zxwb JSON |
Version |
0.1.7
JSON |
| download |
home_page | None |
Summary | None |
upload_time | 2024-12-02 01:10:18 |
maintainer | None |
docs_url | None |
author | HibiKier |
requires_python | <4.0,>=3.10 |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
<div align=center>
<img width="250" height="312" src="https://github.com/HibiKier/nonebot-plugin-zxwb/blob/main/docs_image/tt.jpg"/>
</div>
<div align="center">
<p>
<img src="https://raw.githubusercontent.com/lgc-NB2Dev/readme/main/template/plugin.svg" alt="NoneBotPluginText">
</p>
# nonebot-plugin-zxwb
_✨ 基于 [NoneBot2](https://github.com/nonebot/nonebot2) 的一个 词条管理插件 ✨_
![python](https://img.shields.io/badge/python-v3.10%2B-blue)
![nonebot](https://img.shields.io/badge/nonebot-v2.1.3-yellow)
![onebot](https://img.shields.io/badge/onebot-v11-black)
[![license](https://img.shields.io/badge/license-AGPL3.0-FE7D37)](https://github.com/HibiKier/zhenxun_bot/blob/main/LICENSE)
</div>
## 📖 介绍
[小真寻](https://github.com/HibiKier/zhenxun_bot)会替你记住一切的!
- 对 全局/群组/私聊 进行区分
- 支持 精准/模糊/正则/图片 匹配
- 支持 多词条匹配,当同一问题拥有相同回答时,随机返回一个
- 超级管理员/群组管理员 拥有群组内增删改权限
- 超级管理员 拥有全局/群组/私聊增删改权限
> [!NOTE]
>
> <div align="center"><b>小真寻也很可爱呀,也会很喜欢你!</b></div>
>
> <div align="center">
> <img width="235" height="235" src="https://github.com/HibiKier/nonebot-plugin-zxwb/blob/main/docs_image/tt3.png"/>
> <img width="235" height="235" src="https://github.com/HibiKier/nonebot-plugin-zxwb/blob/main/docs_image/tt1.png"/>
> <img width="235" height="235" src="https://github.com/HibiKier/nonebot-plugin-zxwb/blob/main/docs_image/tt2.png"/>
> </div>
## 💿 安装
```python
pip install nonebot-plugin-zxwb
```
```python
nb plugin install nonebot-plugin-zxwb
```
## ⚙️ 配置
| 配置 | 类型 | 默认值 | 说明 |
| :---------------------- | :--: | :---------------------------: | ---------------------------------------------------------------- |
| zxwb_db_url | str | None | 数据库地址 URL,不填入时使用默认为 sqlite |
## 🎉 帮助
**群组管理员**
```
对指定问题的随机回答,对相同问题可以设置多个不同回答
删除词条后每个词条的id可能会变化,请查看后再删除
更推荐使用id方式删除
问题回答支持的类型:at, image
查看词条命令:群聊时为 群词条+全局词条,私聊时为 私聊词条+全局词条
添加词条正则:添加词条(模糊|正则|图片)?问\s*?(\S*\s?\S*)\s*?答\s?(\S*)
正则问可以通过$1类推()捕获的组
注意:可以通过引用来提供回答, 如:(引用)添加词条问你好
指令:
添加词条 ?[模糊|正则|图片]问...答...:添加问答词条,可重复添加相同问题的不同回答
示例:
添加词条问你好答你也好
添加词条图片问答看看涩图
删除词条 ?[问题] ?[序号] ?[回答序号]:删除指定词条指定或全部回答
示例:
删除词条 谁是萝莉 : 删除文字是 谁是萝莉 的词条
删除词条 --id 2 : 删除序号为2的词条
删除词条 谁是萝莉 --aid 2 : 删除 谁是萝莉 词条的第2个回答
删除词条 --id 2 --aid 2 : 删除序号为2词条的第2个回答
修改词条 [替换文字] ?[旧词条文字] ?[序号]:修改词条问题
示例:
修改词条 谁是萝莉 谁是萝莉啊? : 将词条 谁是萝莉 修改为 谁是萝莉啊?
修改词条 谁是萝莉 --id 2 : 将序号为2的词条修改为 谁是萝莉
查看词条 ?[问题] ?[序号]:查看全部词条或对应词条回答
示例:
查看词条:
(在群组中使用时): 查看当前群组词条和全局词条
(在私聊中使用时): 查看当前私聊词条和全局词条
查看词条 谁是萝莉 : 查看词条 谁是萝莉 的全部回答
查看词条 --id 2 : 查看词条序号为2的全部回答
查看词条 谁是萝莉 --all: 查看全局词条 谁是萝莉 的全部回答
查看词条 --id 2 --all: 查看全局词条序号为2的全部回答
查看词条:
(在群组中使用时): 查看当前群组词条和全局词条
(在私聊中使用时): 查看当前私聊词条和全局词条
查看词条 谁是萝莉 : 查看词条 谁是萝莉 的全部回答
查看词条 --id 2 : 查看词条序号为2的全部回答
查看词条 谁是萝莉 --all: 查看全局词条 谁是萝莉 的全部回答
查看词条 --id 2 --all: 查看全局词条序号为2的全部回答
```
**超级用户**
```
在私聊中超级用户额外设置
指令:
(全局|私聊)?添加词条\s*?(模糊|正则|图片)?问\s*?(\S*\s?\S*)\s*?答\s?(\S*):添加问答词条,可重复添加相同问题的不同回答
全局添加词条
私聊添加词条
(私聊情况下)删除词条: 删除私聊词条
(私聊情况下)修改词条: 修改私聊词条
通过添加参数 --all才指定全局词条
示例:
删除词条 --id 2 --all: 删除全局词条中序号为2的词条
用法与普通用法相同
```
## ❤ 感谢
- 可爱的小真寻 Bot [`zhenxun_bot`](https://github.com/HibiKier/zhenxun_bot): 我谢我自己,桀桀桀
Raw data
{
"_id": null,
"home_page": null,
"name": "nonebot-plugin-zxwb",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": null,
"keywords": null,
"author": "HibiKier",
"author_email": "775757368@qq.com",
"download_url": "https://files.pythonhosted.org/packages/f2/a1/981f3e66ff89cdb586902cc2e9169555fc56f434f36357f56873e3708f16/nonebot_plugin_zxwb-0.1.7.tar.gz",
"platform": null,
"description": "<div align=center>\n\n<img width=\"250\" height=\"312\" src=\"https://github.com/HibiKier/nonebot-plugin-zxwb/blob/main/docs_image/tt.jpg\"/>\n\n</div>\n\n<div align=\"center\">\n\n<p>\n <img src=\"https://raw.githubusercontent.com/lgc-NB2Dev/readme/main/template/plugin.svg\" alt=\"NoneBotPluginText\">\n</p>\n\n# nonebot-plugin-zxwb\n\n_\u2728 \u57fa\u4e8e [NoneBot2](https://github.com/nonebot/nonebot2) \u7684\u4e00\u4e2a \u8bcd\u6761\u7ba1\u7406\u63d2\u4ef6 \u2728_\n\n![python](https://img.shields.io/badge/python-v3.10%2B-blue)\n![nonebot](https://img.shields.io/badge/nonebot-v2.1.3-yellow)\n![onebot](https://img.shields.io/badge/onebot-v11-black)\n[![license](https://img.shields.io/badge/license-AGPL3.0-FE7D37)](https://github.com/HibiKier/zhenxun_bot/blob/main/LICENSE)\n\n</div>\n\n## \ud83d\udcd6 \u4ecb\u7ecd\n\n[\u5c0f\u771f\u5bfb](https://github.com/HibiKier/zhenxun_bot)\u4f1a\u66ff\u4f60\u8bb0\u4f4f\u4e00\u5207\u7684\uff01\n\n- \u5bf9 \u5168\u5c40/\u7fa4\u7ec4/\u79c1\u804a \u8fdb\u884c\u533a\u5206\n- \u652f\u6301 \u7cbe\u51c6/\u6a21\u7cca/\u6b63\u5219/\u56fe\u7247 \u5339\u914d\n- \u652f\u6301 \u591a\u8bcd\u6761\u5339\u914d\uff0c\u5f53\u540c\u4e00\u95ee\u9898\u62e5\u6709\u76f8\u540c\u56de\u7b54\u65f6\uff0c\u968f\u673a\u8fd4\u56de\u4e00\u4e2a\n- \u8d85\u7ea7\u7ba1\u7406\u5458/\u7fa4\u7ec4\u7ba1\u7406\u5458 \u62e5\u6709\u7fa4\u7ec4\u5185\u589e\u5220\u6539\u6743\u9650\n- \u8d85\u7ea7\u7ba1\u7406\u5458 \u62e5\u6709\u5168\u5c40/\u7fa4\u7ec4/\u79c1\u804a\u589e\u5220\u6539\u6743\u9650\n\n> [!NOTE]\n>\n> <div align=\"center\"><b>\u5c0f\u771f\u5bfb\u4e5f\u5f88\u53ef\u7231\u5440\uff0c\u4e5f\u4f1a\u5f88\u559c\u6b22\u4f60\uff01</b></div>\n>\n> <div align=\"center\">\n> <img width=\"235\" height=\"235\" src=\"https://github.com/HibiKier/nonebot-plugin-zxwb/blob/main/docs_image/tt3.png\"/>\n> <img width=\"235\" height=\"235\" src=\"https://github.com/HibiKier/nonebot-plugin-zxwb/blob/main/docs_image/tt1.png\"/>\n> <img width=\"235\" height=\"235\" src=\"https://github.com/HibiKier/nonebot-plugin-zxwb/blob/main/docs_image/tt2.png\"/>\n> </div>\n\n## \ud83d\udcbf \u5b89\u88c5\n\n```python\npip install nonebot-plugin-zxwb\n```\n\n```python\nnb plugin install nonebot-plugin-zxwb\n```\n\n## \u2699\ufe0f \u914d\u7f6e\n\n| \u914d\u7f6e | \u7c7b\u578b | \u9ed8\u8ba4\u503c | \u8bf4\u660e |\n| :---------------------- | :--: | :---------------------------: | ---------------------------------------------------------------- | \n| zxwb_db_url | str | None | \u6570\u636e\u5e93\u5730\u5740 URL\uff0c\u4e0d\u586b\u5165\u65f6\u4f7f\u7528\u9ed8\u8ba4\u4e3a sqlite |\n\n## \ud83c\udf89 \u5e2e\u52a9\n\n**\u7fa4\u7ec4\u7ba1\u7406\u5458**\n\n```\n\u5bf9\u6307\u5b9a\u95ee\u9898\u7684\u968f\u673a\u56de\u7b54\uff0c\u5bf9\u76f8\u540c\u95ee\u9898\u53ef\u4ee5\u8bbe\u7f6e\u591a\u4e2a\u4e0d\u540c\u56de\u7b54\n\u5220\u9664\u8bcd\u6761\u540e\u6bcf\u4e2a\u8bcd\u6761\u7684id\u53ef\u80fd\u4f1a\u53d8\u5316\uff0c\u8bf7\u67e5\u770b\u540e\u518d\u5220\u9664\n\u66f4\u63a8\u8350\u4f7f\u7528id\u65b9\u5f0f\u5220\u9664\n\u95ee\u9898\u56de\u7b54\u652f\u6301\u7684\u7c7b\u578b\uff1aat, image\n\u67e5\u770b\u8bcd\u6761\u547d\u4ee4\uff1a\u7fa4\u804a\u65f6\u4e3a \u7fa4\u8bcd\u6761+\u5168\u5c40\u8bcd\u6761\uff0c\u79c1\u804a\u65f6\u4e3a \u79c1\u804a\u8bcd\u6761+\u5168\u5c40\u8bcd\u6761\n\u6dfb\u52a0\u8bcd\u6761\u6b63\u5219\uff1a\u6dfb\u52a0\u8bcd\u6761(\u6a21\u7cca|\u6b63\u5219|\u56fe\u7247)?\u95ee\\s*?(\\S*\\s?\\S*)\\s*?\u7b54\\s?(\\S*)\n\u6b63\u5219\u95ee\u53ef\u4ee5\u901a\u8fc7$1\u7c7b\u63a8()\u6355\u83b7\u7684\u7ec4\n\u6ce8\u610f\uff1a\u53ef\u4ee5\u901a\u8fc7\u5f15\u7528\u6765\u63d0\u4f9b\u56de\u7b54\uff0c \u5982\uff1a\uff08\u5f15\u7528\uff09\u6dfb\u52a0\u8bcd\u6761\u95ee\u4f60\u597d\n\u6307\u4ee4\uff1a\n \u6dfb\u52a0\u8bcd\u6761 ?[\u6a21\u7cca|\u6b63\u5219|\u56fe\u7247]\u95ee...\u7b54...\uff1a\u6dfb\u52a0\u95ee\u7b54\u8bcd\u6761\uff0c\u53ef\u91cd\u590d\u6dfb\u52a0\u76f8\u540c\u95ee\u9898\u7684\u4e0d\u540c\u56de\u7b54\n \u793a\u4f8b:\n \u6dfb\u52a0\u8bcd\u6761\u95ee\u4f60\u597d\u7b54\u4f60\u4e5f\u597d\n \u6dfb\u52a0\u8bcd\u6761\u56fe\u7247\u95ee\u7b54\u770b\u770b\u6da9\u56fe\n \u5220\u9664\u8bcd\u6761 ?[\u95ee\u9898] ?[\u5e8f\u53f7] ?[\u56de\u7b54\u5e8f\u53f7]\uff1a\u5220\u9664\u6307\u5b9a\u8bcd\u6761\u6307\u5b9a\u6216\u5168\u90e8\u56de\u7b54\n \u793a\u4f8b:\n \u5220\u9664\u8bcd\u6761 \u8c01\u662f\u841d\u8389 : \u5220\u9664\u6587\u5b57\u662f \u8c01\u662f\u841d\u8389 \u7684\u8bcd\u6761\n \u5220\u9664\u8bcd\u6761 --id 2 : \u5220\u9664\u5e8f\u53f7\u4e3a2\u7684\u8bcd\u6761\n \u5220\u9664\u8bcd\u6761 \u8c01\u662f\u841d\u8389 --aid 2 : \u5220\u9664 \u8c01\u662f\u841d\u8389 \u8bcd\u6761\u7684\u7b2c2\u4e2a\u56de\u7b54\n \u5220\u9664\u8bcd\u6761 --id 2 --aid 2 : \u5220\u9664\u5e8f\u53f7\u4e3a2\u8bcd\u6761\u7684\u7b2c2\u4e2a\u56de\u7b54\n \u4fee\u6539\u8bcd\u6761 [\u66ff\u6362\u6587\u5b57] ?[\u65e7\u8bcd\u6761\u6587\u5b57] ?[\u5e8f\u53f7]\uff1a\u4fee\u6539\u8bcd\u6761\u95ee\u9898\n \u793a\u4f8b:\n \u4fee\u6539\u8bcd\u6761 \u8c01\u662f\u841d\u8389 \u8c01\u662f\u841d\u8389\u554a\uff1f : \u5c06\u8bcd\u6761 \u8c01\u662f\u841d\u8389 \u4fee\u6539\u4e3a \u8c01\u662f\u841d\u8389\u554a\uff1f\n \u4fee\u6539\u8bcd\u6761 \u8c01\u662f\u841d\u8389 --id 2 : \u5c06\u5e8f\u53f7\u4e3a2\u7684\u8bcd\u6761\u4fee\u6539\u4e3a \u8c01\u662f\u841d\u8389\n \u67e5\u770b\u8bcd\u6761 ?[\u95ee\u9898] ?[\u5e8f\u53f7]\uff1a\u67e5\u770b\u5168\u90e8\u8bcd\u6761\u6216\u5bf9\u5e94\u8bcd\u6761\u56de\u7b54\n \u793a\u4f8b:\n \u67e5\u770b\u8bcd\u6761:\n (\u5728\u7fa4\u7ec4\u4e2d\u4f7f\u7528\u65f6): \u67e5\u770b\u5f53\u524d\u7fa4\u7ec4\u8bcd\u6761\u548c\u5168\u5c40\u8bcd\u6761\n (\u5728\u79c1\u804a\u4e2d\u4f7f\u7528\u65f6): \u67e5\u770b\u5f53\u524d\u79c1\u804a\u8bcd\u6761\u548c\u5168\u5c40\u8bcd\u6761\n \u67e5\u770b\u8bcd\u6761 \u8c01\u662f\u841d\u8389 : \u67e5\u770b\u8bcd\u6761 \u8c01\u662f\u841d\u8389 \u7684\u5168\u90e8\u56de\u7b54\n \u67e5\u770b\u8bcd\u6761 --id 2 : \u67e5\u770b\u8bcd\u6761\u5e8f\u53f7\u4e3a2\u7684\u5168\u90e8\u56de\u7b54\n \u67e5\u770b\u8bcd\u6761 \u8c01\u662f\u841d\u8389 --all: \u67e5\u770b\u5168\u5c40\u8bcd\u6761 \u8c01\u662f\u841d\u8389 \u7684\u5168\u90e8\u56de\u7b54\n \u67e5\u770b\u8bcd\u6761 --id 2 --all: \u67e5\u770b\u5168\u5c40\u8bcd\u6761\u5e8f\u53f7\u4e3a2\u7684\u5168\u90e8\u56de\u7b54\n \u67e5\u770b\u8bcd\u6761:\n (\u5728\u7fa4\u7ec4\u4e2d\u4f7f\u7528\u65f6): \u67e5\u770b\u5f53\u524d\u7fa4\u7ec4\u8bcd\u6761\u548c\u5168\u5c40\u8bcd\u6761\n (\u5728\u79c1\u804a\u4e2d\u4f7f\u7528\u65f6): \u67e5\u770b\u5f53\u524d\u79c1\u804a\u8bcd\u6761\u548c\u5168\u5c40\u8bcd\u6761\n \u67e5\u770b\u8bcd\u6761 \u8c01\u662f\u841d\u8389 : \u67e5\u770b\u8bcd\u6761 \u8c01\u662f\u841d\u8389 \u7684\u5168\u90e8\u56de\u7b54\n \u67e5\u770b\u8bcd\u6761 --id 2 : \u67e5\u770b\u8bcd\u6761\u5e8f\u53f7\u4e3a2\u7684\u5168\u90e8\u56de\u7b54\n \u67e5\u770b\u8bcd\u6761 \u8c01\u662f\u841d\u8389 --all: \u67e5\u770b\u5168\u5c40\u8bcd\u6761 \u8c01\u662f\u841d\u8389 \u7684\u5168\u90e8\u56de\u7b54\n \u67e5\u770b\u8bcd\u6761 --id 2 --all: \u67e5\u770b\u5168\u5c40\u8bcd\u6761\u5e8f\u53f7\u4e3a2\u7684\u5168\u90e8\u56de\u7b54\n```\n\n**\u8d85\u7ea7\u7528\u6237**\n\n```\n\u5728\u79c1\u804a\u4e2d\u8d85\u7ea7\u7528\u6237\u989d\u5916\u8bbe\u7f6e\n\u6307\u4ee4\uff1a\n (\u5168\u5c40|\u79c1\u804a)?\u6dfb\u52a0\u8bcd\u6761\\s*?(\u6a21\u7cca|\u6b63\u5219|\u56fe\u7247)?\u95ee\\s*?(\\S*\\s?\\S*)\\s*?\u7b54\\s?(\\S*)\uff1a\u6dfb\u52a0\u95ee\u7b54\u8bcd\u6761\uff0c\u53ef\u91cd\u590d\u6dfb\u52a0\u76f8\u540c\u95ee\u9898\u7684\u4e0d\u540c\u56de\u7b54\n \u5168\u5c40\u6dfb\u52a0\u8bcd\u6761\n \u79c1\u804a\u6dfb\u52a0\u8bcd\u6761\n \uff08\u79c1\u804a\u60c5\u51b5\u4e0b\uff09\u5220\u9664\u8bcd\u6761: \u5220\u9664\u79c1\u804a\u8bcd\u6761\n \uff08\u79c1\u804a\u60c5\u51b5\u4e0b\uff09\u4fee\u6539\u8bcd\u6761: \u4fee\u6539\u79c1\u804a\u8bcd\u6761\n \u901a\u8fc7\u6dfb\u52a0\u53c2\u6570 --all\u624d\u6307\u5b9a\u5168\u5c40\u8bcd\u6761\n \u793a\u4f8b:\n \u5220\u9664\u8bcd\u6761 --id 2 --all: \u5220\u9664\u5168\u5c40\u8bcd\u6761\u4e2d\u5e8f\u53f7\u4e3a2\u7684\u8bcd\u6761\n \u7528\u6cd5\u4e0e\u666e\u901a\u7528\u6cd5\u76f8\u540c\n```\n\n\n## \u2764 \u611f\u8c22\n\n- \u53ef\u7231\u7684\u5c0f\u771f\u5bfb Bot [`zhenxun_bot`](https://github.com/HibiKier/zhenxun_bot): \u6211\u8c22\u6211\u81ea\u5df1\uff0c\u6840\u6840\u6840\n",
"bugtrack_url": null,
"license": null,
"summary": null,
"version": "0.1.7",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "415efcef1073b650a07c67fed26d2a5fd0dd3213b172513a215a04f44e920e3b",
"md5": "1423fb9c1d8dec51847e956decef784c",
"sha256": "c13619bf8eb57a3fc2add309eb6f6bc25fe5f2b2aa4755477a0203ee62800b70"
},
"downloads": -1,
"filename": "nonebot_plugin_zxwb-0.1.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1423fb9c1d8dec51847e956decef784c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 31708,
"upload_time": "2024-12-02T01:10:16",
"upload_time_iso_8601": "2024-12-02T01:10:16.394481Z",
"url": "https://files.pythonhosted.org/packages/41/5e/fcef1073b650a07c67fed26d2a5fd0dd3213b172513a215a04f44e920e3b/nonebot_plugin_zxwb-0.1.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f2a1981f3e66ff89cdb586902cc2e9169555fc56f434f36357f56873e3708f16",
"md5": "9c12e09178eae89d7a9f955209af8385",
"sha256": "e8892ff6eb46df9292ca146efaf2a3fd10f20e324cbef91fb93dc653101f4afa"
},
"downloads": -1,
"filename": "nonebot_plugin_zxwb-0.1.7.tar.gz",
"has_sig": false,
"md5_digest": "9c12e09178eae89d7a9f955209af8385",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 27566,
"upload_time": "2024-12-02T01:10:18",
"upload_time_iso_8601": "2024-12-02T01:10:18.432592Z",
"url": "https://files.pythonhosted.org/packages/f2/a1/981f3e66ff89cdb586902cc2e9169555fc56f434f36357f56873e3708f16/nonebot_plugin_zxwb-0.1.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-02 01:10:18",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "nonebot-plugin-zxwb"
}