nonebot-plugin-antiinsult


Namenonebot-plugin-antiinsult JSON
Version 0.7.1 PyPI version JSON
download
home_pagehttps://github.com/tkgs0/nonebot-plugin-antiinsult
SummaryAnti-insult in NoneBot2
upload_time2024-08-31 15:40:36
maintainerNone
docs_urlNone
author月ヶ瀬
requires_python<4.0,>=3.9
licenseMIT
keywords nonebot anti_insult anti_abuse
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">
  <a href="https://v2.nonebot.dev/store"><img src="https://raw.githubusercontent.com/tkgs0/nbpt/resources/nbp_logo.png" width="180" height="180" alt="NoneBotPluginLogo"></a>
  <br>
  <p><img src="https://raw.githubusercontent.com/tkgs0/nbpt/resources/NoneBotPlugin.svg" width="240" alt="NoneBotPluginText"></p>
</div>

<div align="center">

# nonebot-plugin-antiinsult
  
_✨ NoneBot 反嘴臭插件 ✨_
  

<a href="./LICENSE">
    <img src="https://img.shields.io/github/license/tkgs0/nonebot-plugin-antiinsult.svg" alt="license">
</a>
<a href="https://pypi.python.org/pypi/nonebot-plugin-antiinsult">
    <img src="https://img.shields.io/pypi/v/nonebot-plugin-antiinsult.svg" alt="pypi">
</a>
<a href="https://www.python.org">
    <img src="https://img.shields.io/badge/python-3.9+-blue.svg" alt="python">
</a>
<a href="https://nonebot.dev">
    <img src="https://img.shields.io/badge/nonebot-2.3.1+-red.svg" alt="nonebot">
</a>
<a href="https://onebot.adapters.nonebot.dev">
    <img src="https://img.shields.io/badge/OneBot-11-black?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHAAAABwCAMAAADxPgR5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAxQTFRF////29vbr6+vAAAAk1hCcwAAAAR0Uk5T////AEAqqfQAAAKcSURBVHja7NrbctswDATQXfD//zlpO7FlmwAWIOnOtNaTM5JwDMa8E+PNFz7g3waJ24fviyDPgfhz8fHP39cBcBL9KoJbQUxjA2iYqHL3FAnvzhL4GtVNUcoSZe6eSHizBcK5LL7dBr2AUZlev1ARRHCljzRALIEog6H3U6bCIyqIZdAT0eBuJYaGiJaHSjmkYIZd+qSGWAQnIaz2OArVnX6vrItQvbhZJtVGB5qX9wKqCMkb9W7aexfCO/rwQRBzsDIsYx4AOz0nhAtWu7bqkEQBO0Pr+Ftjt5fFCUEbm0Sbgdu8WSgJ5NgH2iu46R/o1UcBXJsFusWF/QUaz3RwJMEgngfaGGdSxJkE/Yg4lOBryBiMwvAhZrVMUUvwqU7F05b5WLaUIN4M4hRocQQRnEedgsn7TZB3UCpRrIJwQfqvGwsg18EnI2uSVNC8t+0QmMXogvbPg/xk+Mnw/6kW/rraUlvqgmFreAA09xW5t0AFlHrQZ3CsgvZm0FbHNKyBmheBKIF2cCA8A600aHPmFtRB1XvMsJAiza7LpPog0UJwccKdzw8rdf8MyN2ePYF896LC5hTzdZqxb6VNXInaupARLDNBWgI8spq4T0Qb5H4vWfPmHo8OyB1ito+AysNNz0oglj1U955sjUN9d41LnrX2D/u7eRwxyOaOpfyevCWbTgDEoilsOnu7zsKhjRCsnD/QzhdkYLBLXjiK4f3UWmcx2M7PO21CKVTH84638NTplt6JIQH0ZwCNuiWAfvuLhdrcOYPVO9eW3A67l7hZtgaY9GZo9AFc6cryjoeFBIWeU+npnk/nLE0OxCHL1eQsc1IciehjpJv5mqCsjeopaH6r15/MrxNnVhu7tmcslay2gO2Z1QfcfX0JMACG41/u0RrI9QAAAABJRU5ErkJggg==" alt="onebot">
</a>

</div>

  
## 📖 介绍
  
**本插件为被动插件**  
  
检测到有用户 `@机器人` 并嘴臭时将其临时屏蔽(bot重启后失效)  
当bot为群管理时会请对方喝昏睡红茶(禁言)  
  
- 超级用户不受临时屏蔽影响 _~~但是会被昏睡红茶影响~~_  
- 当bot的群权限比超级用户高的时候, 超级用户也有机会品尝昏睡红茶  
- 被bot灌了昏睡红茶的用户不会进临时黑名单  
- 开启 **`对线模式`** 后不会被bot灌昏睡红茶和临时拉黑 (~~因为要对线~~)  
  
  
## 💿 安装

**nb-cli安装, 包管理器安装  二选一**

<details>
<summary>使用 nb-cli 安装</summary>

在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装

    nb plugin install nonebot-plugin-antiinsult

</details>

<details>
<summary>使用包管理器安装</summary>

在 nonebot2 项目的插件目录下, 打开命令行,

**根据你使用的包管理器, 输入相应的安装命令**

<details>
<summary>pip</summary>

    pip install nonebot-plugin-antiinsult

</details>
<details>
<summary>pdm</summary>

    pdm add nonebot-plugin-antiinsult

</details>
<details>
<summary>poetry</summary>

    poetry add nonebot-plugin-antiinsult

</details>
<details>
<summary>conda</summary>

    conda install nonebot-plugin-antiinsult

</details>

打开 bot项目下的 `pyproject.toml` 文件,

在其 `plugins` 里加入 `nonebot_plugin_antiinsult`

    plugins = ["nonebot_plugin_antiinsult"]

</details>
</details>

## 🎉 使用

在Bot目录下的 `.env` 文件内可添加以下变量以设置禁言时长:

```env
ANTI_INSULT_BAN_TIME=720
```

单位为分钟, 默认值720分钟(12小时)

### 指令表

<table> 
  <tr align="center">
    <th> 指令 </th>
    <th> 权限 </th>
    <th> 需要@ </th>
    <th> 范围 </th>
    <th> 说明 </th>
  </tr>
  <tr align="center">
    <td> ^(添加|删除)屏蔽词 xxx </td>
    <td> 主人 </td>
    <td> 否 </td>
    <td> 私聊 | 群聊 </td>
    <td rowspan="2"> 可输入多个,<br>用空格隔开 </td>
  </tr>
  <tr align="center">
    <td> 解除屏蔽 qq </td>
    <td> 主人 </td>
    <td> 否 </td>
    <td> 私聊 | 群聊 </td>
  </tr>
  <tr align="center">
    <td> 查看临时黑名单 </td>
    <td> 主人 </td>
    <td> 否 </td>
    <td> 私聊 | 群聊 </td>
    <td> </td>
  </tr>
  <tr align="center">
    <td> ^(禁用|启用)飞(妈|马|🐴|🐎)令 </td>
    <td> 主人 </td>
    <td> 否 </td>
    <td> 私聊 | 群聊 </td>
    <td> 开启/关闭对线模式 </td>
</table>

P.S. `解除屏蔽` 可以解除临时屏蔽, 也可以解除禁言(当然, 需要bot为群管理).  
  
你说从聊天界面查看屏蔽词库? 噢, 我亲爱的老伙计, 你怕是疯了!  
  
## ⚠️ 注意事项

**本插件目前仅支持 nonebot2 + onebot.v11 的使用方式, 一切非此二者结合的使用方式造成的问题请自行探索解决, 或者使用其他插件**


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/tkgs0/nonebot-plugin-antiinsult",
    "name": "nonebot-plugin-antiinsult",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": "nonebot, anti_insult, anti_abuse",
    "author": "\u6708\u30f6\u702c",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/da/2b/18c8ac3bfb92d362f3759fddd24f144d6f3c406dcebc8a3b2715cdf5f2fb/nonebot_plugin_antiinsult-0.7.1.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n  <a href=\"https://v2.nonebot.dev/store\"><img src=\"https://raw.githubusercontent.com/tkgs0/nbpt/resources/nbp_logo.png\" width=\"180\" height=\"180\" alt=\"NoneBotPluginLogo\"></a>\n  <br>\n  <p><img src=\"https://raw.githubusercontent.com/tkgs0/nbpt/resources/NoneBotPlugin.svg\" width=\"240\" alt=\"NoneBotPluginText\"></p>\n</div>\n\n<div align=\"center\">\n\n# nonebot-plugin-antiinsult\n  \n_\u2728 NoneBot \u53cd\u5634\u81ed\u63d2\u4ef6 \u2728_\n  \n\n<a href=\"./LICENSE\">\n    <img src=\"https://img.shields.io/github/license/tkgs0/nonebot-plugin-antiinsult.svg\" alt=\"license\">\n</a>\n<a href=\"https://pypi.python.org/pypi/nonebot-plugin-antiinsult\">\n    <img src=\"https://img.shields.io/pypi/v/nonebot-plugin-antiinsult.svg\" alt=\"pypi\">\n</a>\n<a href=\"https://www.python.org\">\n    <img src=\"https://img.shields.io/badge/python-3.9+-blue.svg\" alt=\"python\">\n</a>\n<a href=\"https://nonebot.dev\">\n    <img src=\"https://img.shields.io/badge/nonebot-2.3.1+-red.svg\" alt=\"nonebot\">\n</a>\n<a href=\"https://onebot.adapters.nonebot.dev\">\n    <img src=\"https://img.shields.io/badge/OneBot-11-black?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHAAAABwCAMAAADxPgR5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAxQTFRF////29vbr6+vAAAAk1hCcwAAAAR0Uk5T////AEAqqfQAAAKcSURBVHja7NrbctswDATQXfD//zlpO7FlmwAWIOnOtNaTM5JwDMa8E+PNFz7g3waJ24fviyDPgfhz8fHP39cBcBL9KoJbQUxjA2iYqHL3FAnvzhL4GtVNUcoSZe6eSHizBcK5LL7dBr2AUZlev1ARRHCljzRALIEog6H3U6bCIyqIZdAT0eBuJYaGiJaHSjmkYIZd+qSGWAQnIaz2OArVnX6vrItQvbhZJtVGB5qX9wKqCMkb9W7aexfCO/rwQRBzsDIsYx4AOz0nhAtWu7bqkEQBO0Pr+Ftjt5fFCUEbm0Sbgdu8WSgJ5NgH2iu46R/o1UcBXJsFusWF/QUaz3RwJMEgngfaGGdSxJkE/Yg4lOBryBiMwvAhZrVMUUvwqU7F05b5WLaUIN4M4hRocQQRnEedgsn7TZB3UCpRrIJwQfqvGwsg18EnI2uSVNC8t+0QmMXogvbPg/xk+Mnw/6kW/rraUlvqgmFreAA09xW5t0AFlHrQZ3CsgvZm0FbHNKyBmheBKIF2cCA8A600aHPmFtRB1XvMsJAiza7LpPog0UJwccKdzw8rdf8MyN2ePYF896LC5hTzdZqxb6VNXInaupARLDNBWgI8spq4T0Qb5H4vWfPmHo8OyB1ito+AysNNz0oglj1U955sjUN9d41LnrX2D/u7eRwxyOaOpfyevCWbTgDEoilsOnu7zsKhjRCsnD/QzhdkYLBLXjiK4f3UWmcx2M7PO21CKVTH84638NTplt6JIQH0ZwCNuiWAfvuLhdrcOYPVO9eW3A67l7hZtgaY9GZo9AFc6cryjoeFBIWeU+npnk/nLE0OxCHL1eQsc1IciehjpJv5mqCsjeopaH6r15/MrxNnVhu7tmcslay2gO2Z1QfcfX0JMACG41/u0RrI9QAAAABJRU5ErkJggg==\" alt=\"onebot\">\n</a>\n\n</div>\n\n  \n## \ud83d\udcd6 \u4ecb\u7ecd\n  \n**\u672c\u63d2\u4ef6\u4e3a\u88ab\u52a8\u63d2\u4ef6**  \n  \n\u68c0\u6d4b\u5230\u6709\u7528\u6237 `@\u673a\u5668\u4eba` \u5e76\u5634\u81ed\u65f6\u5c06\u5176\u4e34\u65f6\u5c4f\u853d(bot\u91cd\u542f\u540e\u5931\u6548)  \n\u5f53bot\u4e3a\u7fa4\u7ba1\u7406\u65f6\u4f1a\u8bf7\u5bf9\u65b9\u559d\u660f\u7761\u7ea2\u8336(\u7981\u8a00)  \n  \n- \u8d85\u7ea7\u7528\u6237\u4e0d\u53d7\u4e34\u65f6\u5c4f\u853d\u5f71\u54cd _~~\u4f46\u662f\u4f1a\u88ab\u660f\u7761\u7ea2\u8336\u5f71\u54cd~~_  \n- \u5f53bot\u7684\u7fa4\u6743\u9650\u6bd4\u8d85\u7ea7\u7528\u6237\u9ad8\u7684\u65f6\u5019, \u8d85\u7ea7\u7528\u6237\u4e5f\u6709\u673a\u4f1a\u54c1\u5c1d\u660f\u7761\u7ea2\u8336  \n- \u88abbot\u704c\u4e86\u660f\u7761\u7ea2\u8336\u7684\u7528\u6237\u4e0d\u4f1a\u8fdb\u4e34\u65f6\u9ed1\u540d\u5355  \n- \u5f00\u542f **`\u5bf9\u7ebf\u6a21\u5f0f`** \u540e\u4e0d\u4f1a\u88abbot\u704c\u660f\u7761\u7ea2\u8336\u548c\u4e34\u65f6\u62c9\u9ed1 (~~\u56e0\u4e3a\u8981\u5bf9\u7ebf~~)  \n  \n  \n## \ud83d\udcbf \u5b89\u88c5\n\n**nb-cli\u5b89\u88c5, \u5305\u7ba1\u7406\u5668\u5b89\u88c5  \u4e8c\u9009\u4e00**\n\n<details>\n<summary>\u4f7f\u7528 nb-cli \u5b89\u88c5</summary>\n\n\u5728 nonebot2 \u9879\u76ee\u7684\u6839\u76ee\u5f55\u4e0b\u6253\u5f00\u547d\u4ee4\u884c, \u8f93\u5165\u4ee5\u4e0b\u6307\u4ee4\u5373\u53ef\u5b89\u88c5\n\n    nb plugin install nonebot-plugin-antiinsult\n\n</details>\n\n<details>\n<summary>\u4f7f\u7528\u5305\u7ba1\u7406\u5668\u5b89\u88c5</summary>\n\n\u5728 nonebot2 \u9879\u76ee\u7684\u63d2\u4ef6\u76ee\u5f55\u4e0b, \u6253\u5f00\u547d\u4ee4\u884c,\n\n**\u6839\u636e\u4f60\u4f7f\u7528\u7684\u5305\u7ba1\u7406\u5668, \u8f93\u5165\u76f8\u5e94\u7684\u5b89\u88c5\u547d\u4ee4**\n\n<details>\n<summary>pip</summary>\n\n    pip install nonebot-plugin-antiinsult\n\n</details>\n<details>\n<summary>pdm</summary>\n\n    pdm add nonebot-plugin-antiinsult\n\n</details>\n<details>\n<summary>poetry</summary>\n\n    poetry add nonebot-plugin-antiinsult\n\n</details>\n<details>\n<summary>conda</summary>\n\n    conda install nonebot-plugin-antiinsult\n\n</details>\n\n\u6253\u5f00 bot\u9879\u76ee\u4e0b\u7684 `pyproject.toml` \u6587\u4ef6,\n\n\u5728\u5176 `plugins` \u91cc\u52a0\u5165 `nonebot_plugin_antiinsult`\n\n    plugins = [\"nonebot_plugin_antiinsult\"]\n\n</details>\n</details>\n\n## \ud83c\udf89 \u4f7f\u7528\n\n\u5728Bot\u76ee\u5f55\u4e0b\u7684 `.env` \u6587\u4ef6\u5185\u53ef\u6dfb\u52a0\u4ee5\u4e0b\u53d8\u91cf\u4ee5\u8bbe\u7f6e\u7981\u8a00\u65f6\u957f:\n\n```env\nANTI_INSULT_BAN_TIME=720\n```\n\n\u5355\u4f4d\u4e3a\u5206\u949f, \u9ed8\u8ba4\u503c720\u5206\u949f(12\u5c0f\u65f6)\n\n### \u6307\u4ee4\u8868\n\n<table> \n  <tr align=\"center\">\n    <th> \u6307\u4ee4 </th>\n    <th> \u6743\u9650 </th>\n    <th> \u9700\u8981@ </th>\n    <th> \u8303\u56f4 </th>\n    <th> \u8bf4\u660e </th>\n  </tr>\n  <tr align=\"center\">\n    <td> ^(\u6dfb\u52a0|\u5220\u9664)\u5c4f\u853d\u8bcd xxx </td>\n    <td> \u4e3b\u4eba </td>\n    <td> \u5426 </td>\n    <td> \u79c1\u804a | \u7fa4\u804a </td>\n    <td rowspan=\"2\"> \u53ef\u8f93\u5165\u591a\u4e2a,<br>\u7528\u7a7a\u683c\u9694\u5f00 </td>\n  </tr>\n  <tr align=\"center\">\n    <td> \u89e3\u9664\u5c4f\u853d qq </td>\n    <td> \u4e3b\u4eba </td>\n    <td> \u5426 </td>\n    <td> \u79c1\u804a | \u7fa4\u804a </td>\n  </tr>\n  <tr align=\"center\">\n    <td> \u67e5\u770b\u4e34\u65f6\u9ed1\u540d\u5355 </td>\n    <td> \u4e3b\u4eba </td>\n    <td> \u5426 </td>\n    <td> \u79c1\u804a | \u7fa4\u804a </td>\n    <td> </td>\n  </tr>\n  <tr align=\"center\">\n    <td> ^(\u7981\u7528|\u542f\u7528)\u98de(\u5988|\u9a6c|\ud83d\udc34|\ud83d\udc0e)\u4ee4 </td>\n    <td> \u4e3b\u4eba </td>\n    <td> \u5426 </td>\n    <td> \u79c1\u804a | \u7fa4\u804a </td>\n    <td> \u5f00\u542f/\u5173\u95ed\u5bf9\u7ebf\u6a21\u5f0f </td>\n</table>\n\nP.S. `\u89e3\u9664\u5c4f\u853d` \u53ef\u4ee5\u89e3\u9664\u4e34\u65f6\u5c4f\u853d, \u4e5f\u53ef\u4ee5\u89e3\u9664\u7981\u8a00(\u5f53\u7136, \u9700\u8981bot\u4e3a\u7fa4\u7ba1\u7406).  \n  \n\u4f60\u8bf4\u4ece\u804a\u5929\u754c\u9762\u67e5\u770b\u5c4f\u853d\u8bcd\u5e93? \u5662, \u6211\u4eb2\u7231\u7684\u8001\u4f19\u8ba1, \u4f60\u6015\u662f\u75af\u4e86!  \n  \n## \u26a0\ufe0f \u6ce8\u610f\u4e8b\u9879\n\n**\u672c\u63d2\u4ef6\u76ee\u524d\u4ec5\u652f\u6301 nonebot2 + onebot.v11 \u7684\u4f7f\u7528\u65b9\u5f0f, \u4e00\u5207\u975e\u6b64\u4e8c\u8005\u7ed3\u5408\u7684\u4f7f\u7528\u65b9\u5f0f\u9020\u6210\u7684\u95ee\u9898\u8bf7\u81ea\u884c\u63a2\u7d22\u89e3\u51b3, \u6216\u8005\u4f7f\u7528\u5176\u4ed6\u63d2\u4ef6**\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Anti-insult in NoneBot2",
    "version": "0.7.1",
    "project_urls": {
        "Homepage": "https://github.com/tkgs0/nonebot-plugin-antiinsult",
        "Repository": "https://github.com/tkgs0/nonebot-plugin-antiinsult"
    },
    "split_keywords": [
        "nonebot",
        " anti_insult",
        " anti_abuse"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bdc6d527b84502f7fad4f68452fa6cd1995203034a36f48392c7a90a3305cabc",
                "md5": "6c797f04e78992122e56ebdd0efe4d81",
                "sha256": "7562ca642a1e08fb1d0507e3178501f4d87cb790a0b1b5c2935d65455850fd95"
            },
            "downloads": -1,
            "filename": "nonebot_plugin_antiinsult-0.7.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6c797f04e78992122e56ebdd0efe4d81",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 14539,
            "upload_time": "2024-08-31T15:40:34",
            "upload_time_iso_8601": "2024-08-31T15:40:34.525320Z",
            "url": "https://files.pythonhosted.org/packages/bd/c6/d527b84502f7fad4f68452fa6cd1995203034a36f48392c7a90a3305cabc/nonebot_plugin_antiinsult-0.7.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "da2b18c8ac3bfb92d362f3759fddd24f144d6f3c406dcebc8a3b2715cdf5f2fb",
                "md5": "150d8c5f45038b475d58cf023bb87650",
                "sha256": "e1aa359aa945b01d16755b4a9281087e4f42328fd7dc6974cdf63686fa6959f1"
            },
            "downloads": -1,
            "filename": "nonebot_plugin_antiinsult-0.7.1.tar.gz",
            "has_sig": false,
            "md5_digest": "150d8c5f45038b475d58cf023bb87650",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 16566,
            "upload_time": "2024-08-31T15:40:36",
            "upload_time_iso_8601": "2024-08-31T15:40:36.087949Z",
            "url": "https://files.pythonhosted.org/packages/da/2b/18c8ac3bfb92d362f3759fddd24f144d6f3c406dcebc8a3b2715cdf5f2fb/nonebot_plugin_antiinsult-0.7.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-31 15:40:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "tkgs0",
    "github_project": "nonebot-plugin-antiinsult",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "nonebot-plugin-antiinsult"
}
        
Elapsed time: 0.35883s