nonebot_plugin_random_stereotypes


Namenonebot_plugin_random_stereotypes JSON
Version 0.2.1 PyPI version JSON
download
home_pagehttps://github.com/Ikaros-521/nonebot_plugin_random_stereotypes
Summary基于Nonebot2的发病语录插件
upload_time2024-08-24 13:51:04
maintainerNone
docs_urlNone
authorIkaros
requires_python<4.0,>=3.8
licenseMIT
keywords
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://github.com/A-kirami/nonebot-plugin-template/blob/resources/nbp_logo.png" width="180" height="180" alt="NoneBotPluginLogo"></a>
  <br>
  <p><img src="https://github.com/A-kirami/nonebot-plugin-template/blob/resources/NoneBotPlugin.svg" width="240" alt="NoneBotPluginText"></p>
</div>

<div align="center">

# nonebot_plugin_random_stereotypes

_✨ NoneBot 发病语录 ✨_


<a href="https://github.com/Ikaros-521/nonebot_plugin_random_stereotypes/stargazers">
    <img alt="GitHub stars" src="https://img.shields.io/github/stars/Ikaros-521/nonebot_plugin_random_stereotypes?color=%09%2300BFFF&style=flat-square">
</a>
<a href="https://github.com/Ikaros-521/nonebot_plugin_random_stereotypes/issues">
    <img alt="GitHub issues" src="https://img.shields.io/github/issues/Ikaros-521/nonebot_plugin_random_stereotypes?color=Emerald%20green&style=flat-square">
</a>
<a href="https://github.com/Ikaros-521/nonebot_plugin_random_stereotypes/network">
    <img alt="GitHub forks" src="https://img.shields.io/github/forks/Ikaros-521/nonebot_plugin_random_stereotypes?color=%2300BFFF&style=flat-square">
</a>
<a href="./LICENSE">
    <img src="https://img.shields.io/github/license/Ikaros-521/nonebot_plugin_random_stereotypes.svg" alt="license">
</a>
<a href="https://pypi.python.org/pypi/nonebot_plugin_random_stereotypes">
    <img src="https://img.shields.io/pypi/v/nonebot_plugin_random_stereotypes.svg" alt="pypi">
</a>
<a href="https://www.python.org">
    <img src="https://img.shields.io/badge/python-3.8+-blue.svg" alt="python">
</a>

</div>

## 📖 介绍

随机返回一条在互联网上收录一些有趣的发病语录(主要针对VTB)  
如果有需要补充的可以提交issue进行追加,侵删。  

## 💿 安装  

### 1. nb-cli安装(推荐)

在你bot工程的文件夹下,运行cmd(运行路径要对啊),执行nb命令安装插件,插件配置会自动添加至配置文件  

```sh
nb plugin install nonebot_plugin_random_stereotypes
```

### 2. 本地安装

将项目clone到你的机器人插件下的对应插件目录内(一般为机器人文件夹下的`src/plugins`),然后把`nonebot_plugin_random_stereotypes`文件夹里的内容拷贝至上一级目录即可。  
clone命令参考(得先装`git`,懂的都懂):

```sh
git clone https://github.com/Ikaros-521/nonebot_plugin_random_stereotypes.git
```

也可以直接下载压缩包到插件目录解压,然后同样提取`nonebot_plugin_random_stereotypes`至上一级目录。  
目录结构: ```你的bot/src/plugins/nonebot_plugin_random_stereotypes/__init__.py```  

### 3. pip安装

```sh
pip install nonebot_plugin_random_stereotypes
```  

打开 nonebot2 项目的 ```bot.py``` 文件, 在其中写入  
```nonebot.load_plugin('nonebot_plugin_random_stereotypes')```  
当然,如果是默认nb-cli创建的nonebot2的话,在bot路径```pyproject.toml```的```[tool.nonebot]```的```plugins```中添加```nonebot_plugin_random_stereotypes```即可  
pyproject.toml配置例如:  

``` toml
[tool.nonebot]
plugin_dirs = ["src/plugins"]
plugins = ["nonebot_plugin_random_stereotypes"]
```

### 更新版本

```sh
nb plugin update nonebot_plugin_random_stereotypes
```

## 🔧 配置

|  配置项   |     默认值      |                        说明                         |
|:------:|:------------:|:-------------------------------------------------:|
|  stereotypes_cd   |     1800     | 发病次数超过stereotypes_count,则需等待stereotypes_cd秒后才可以发病 |
|  stereotypes_aliases  | ["发电", "发癫"] |                      可选指令前缀                       |
| stereotypes_count |      3       |                    可连续发病的最大次数                     |
| stereotypes_priority |     100      |                       插件优先级                       |
| stereotypes_block  |     False      |                  是否阻止事件向低优先级插件传递                  |


## 🎉 功能

随机生成下标获取本地`data.py`中的一条语录,凭借传入的字符串返回结果。

## 👉 命令

### /发病

命令结构:```/发病 [发病对象]```  
例如:```/发病 测试```  
bot返回内容:  
`电梯里遇到了测试,她按了八层,呵真会暗示,她八层有点喜欢我`  

## ⚙ 拓展

自定义发病语录,修改`data.py`文件,在数组中添加语句即可,对象名用 `{target_name}` 代替,注意格式!  

## 📝 更新日志

<details>
<summary>展开/收起</summary>

### 0.0.1

- 插件初次发布  

### 0.0.2

- 追加发病语录数据  

### 0.2.1

- 追加发病语录数据  

</details>

## 🔧 开发环境

Nonebot2:2.0.0rc3  
python:3.8.13  
操作系统:Windows10(Linux兼容性问题不大)  
编辑器:VS Code  

## 致谢

- [nonebot-plugin-template](https://github.com/A-kirami/nonebot-plugin-template)

## 项目打包上传至pypi

官网:https://pypi.org,注册账号,在系统用户根目录下创建`.pypirc`,配置

```txt
[distutils] 
index-servers=pypi 
 
[pypi] repository = https://upload.pypi.org/legacy/ 
username = 用户名 
password = 密码
```

### poetry

```sh
# 参考 https://www.freesion.com/article/58051228882/
# poetry config pypi-token.pypi

# 1、安装poetry
pip install poetry

# 2、初始化配置文件(根据提示填写)
poetry init

# 3、微调配置文件pyproject.toml

# 4、运行 poetry install, 可生成 “poetry.lock” 文件(可跳过)
poetry install

# 5、编译,生成dist
poetry build

# 6、发布(poetry config pypi-token.pypi 配置token)
poetry publish
```

### twine

```sh
# 参考 https://www.cnblogs.com/danhuai/p/14915042.html
#创建setup.py文件 填写相关信息

# 1、可以先升级打包工具
pip install --upgrade setuptools wheel twine

# 2、打包
python setup.py sdist bdist_wheel

# 3、可以先检查一下包
twine check dist/*

# 4、上传包到pypi(需输入用户名、密码)
twine upload dist/*
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Ikaros-521/nonebot_plugin_random_stereotypes",
    "name": "nonebot_plugin_random_stereotypes",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": "Ikaros",
    "author_email": "327209194@qq.com",
    "download_url": "https://files.pythonhosted.org/packages/8b/01/15c5c1f2c6d2ff87503055a5d6843aa62c5cd9a50de814ab53e259b019c9/nonebot_plugin_random_stereotypes-0.2.1.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n  <a href=\"https://v2.nonebot.dev/store\"><img src=\"https://github.com/A-kirami/nonebot-plugin-template/blob/resources/nbp_logo.png\" width=\"180\" height=\"180\" alt=\"NoneBotPluginLogo\"></a>\n  <br>\n  <p><img src=\"https://github.com/A-kirami/nonebot-plugin-template/blob/resources/NoneBotPlugin.svg\" width=\"240\" alt=\"NoneBotPluginText\"></p>\n</div>\n\n<div align=\"center\">\n\n# nonebot_plugin_random_stereotypes\n\n_\u2728 NoneBot \u53d1\u75c5\u8bed\u5f55 \u2728_\n\n\n<a href=\"https://github.com/Ikaros-521/nonebot_plugin_random_stereotypes/stargazers\">\n    <img alt=\"GitHub stars\" src=\"https://img.shields.io/github/stars/Ikaros-521/nonebot_plugin_random_stereotypes?color=%09%2300BFFF&style=flat-square\">\n</a>\n<a href=\"https://github.com/Ikaros-521/nonebot_plugin_random_stereotypes/issues\">\n    <img alt=\"GitHub issues\" src=\"https://img.shields.io/github/issues/Ikaros-521/nonebot_plugin_random_stereotypes?color=Emerald%20green&style=flat-square\">\n</a>\n<a href=\"https://github.com/Ikaros-521/nonebot_plugin_random_stereotypes/network\">\n    <img alt=\"GitHub forks\" src=\"https://img.shields.io/github/forks/Ikaros-521/nonebot_plugin_random_stereotypes?color=%2300BFFF&style=flat-square\">\n</a>\n<a href=\"./LICENSE\">\n    <img src=\"https://img.shields.io/github/license/Ikaros-521/nonebot_plugin_random_stereotypes.svg\" alt=\"license\">\n</a>\n<a href=\"https://pypi.python.org/pypi/nonebot_plugin_random_stereotypes\">\n    <img src=\"https://img.shields.io/pypi/v/nonebot_plugin_random_stereotypes.svg\" alt=\"pypi\">\n</a>\n<a href=\"https://www.python.org\">\n    <img src=\"https://img.shields.io/badge/python-3.8+-blue.svg\" alt=\"python\">\n</a>\n\n</div>\n\n## \ud83d\udcd6 \u4ecb\u7ecd\n\n\u968f\u673a\u8fd4\u56de\u4e00\u6761\u5728\u4e92\u8054\u7f51\u4e0a\u6536\u5f55\u4e00\u4e9b\u6709\u8da3\u7684\u53d1\u75c5\u8bed\u5f55\uff08\u4e3b\u8981\u9488\u5bf9VTB\uff09  \n\u5982\u679c\u6709\u9700\u8981\u8865\u5145\u7684\u53ef\u4ee5\u63d0\u4ea4issue\u8fdb\u884c\u8ffd\u52a0\uff0c\u4fb5\u5220\u3002  \n\n## \ud83d\udcbf \u5b89\u88c5  \n\n### 1. nb-cli\u5b89\u88c5\uff08\u63a8\u8350\uff09\n\n\u5728\u4f60bot\u5de5\u7a0b\u7684\u6587\u4ef6\u5939\u4e0b\uff0c\u8fd0\u884ccmd\uff08\u8fd0\u884c\u8def\u5f84\u8981\u5bf9\u554a\uff09\uff0c\u6267\u884cnb\u547d\u4ee4\u5b89\u88c5\u63d2\u4ef6\uff0c\u63d2\u4ef6\u914d\u7f6e\u4f1a\u81ea\u52a8\u6dfb\u52a0\u81f3\u914d\u7f6e\u6587\u4ef6  \n\n```sh\nnb plugin install nonebot_plugin_random_stereotypes\n```\n\n### 2. \u672c\u5730\u5b89\u88c5\n\n\u5c06\u9879\u76eeclone\u5230\u4f60\u7684\u673a\u5668\u4eba\u63d2\u4ef6\u4e0b\u7684\u5bf9\u5e94\u63d2\u4ef6\u76ee\u5f55\u5185\uff08\u4e00\u822c\u4e3a\u673a\u5668\u4eba\u6587\u4ef6\u5939\u4e0b\u7684`src/plugins`\uff09\uff0c\u7136\u540e\u628a`nonebot_plugin_random_stereotypes`\u6587\u4ef6\u5939\u91cc\u7684\u5185\u5bb9\u62f7\u8d1d\u81f3\u4e0a\u4e00\u7ea7\u76ee\u5f55\u5373\u53ef\u3002  \nclone\u547d\u4ee4\u53c2\u8003\uff08\u5f97\u5148\u88c5`git`\uff0c\u61c2\u7684\u90fd\u61c2\uff09\uff1a\n\n```sh\ngit clone https://github.com/Ikaros-521/nonebot_plugin_random_stereotypes.git\n```\n\n\u4e5f\u53ef\u4ee5\u76f4\u63a5\u4e0b\u8f7d\u538b\u7f29\u5305\u5230\u63d2\u4ef6\u76ee\u5f55\u89e3\u538b\uff0c\u7136\u540e\u540c\u6837\u63d0\u53d6`nonebot_plugin_random_stereotypes`\u81f3\u4e0a\u4e00\u7ea7\u76ee\u5f55\u3002  \n\u76ee\u5f55\u7ed3\u6784\uff1a ```\u4f60\u7684bot/src/plugins/nonebot_plugin_random_stereotypes/__init__.py```  \n\n### 3. pip\u5b89\u88c5\n\n```sh\npip install nonebot_plugin_random_stereotypes\n```  \n\n\u6253\u5f00 nonebot2 \u9879\u76ee\u7684 ```bot.py``` \u6587\u4ef6, \u5728\u5176\u4e2d\u5199\u5165  \n```nonebot.load_plugin('nonebot_plugin_random_stereotypes')```  \n\u5f53\u7136\uff0c\u5982\u679c\u662f\u9ed8\u8ba4nb-cli\u521b\u5efa\u7684nonebot2\u7684\u8bdd\uff0c\u5728bot\u8def\u5f84```pyproject.toml```\u7684```[tool.nonebot]```\u7684```plugins```\u4e2d\u6dfb\u52a0```nonebot_plugin_random_stereotypes```\u5373\u53ef  \npyproject.toml\u914d\u7f6e\u4f8b\u5982\uff1a  \n\n``` toml\n[tool.nonebot]\nplugin_dirs = [\"src/plugins\"]\nplugins = [\"nonebot_plugin_random_stereotypes\"]\n```\n\n### \u66f4\u65b0\u7248\u672c\n\n```sh\nnb plugin update nonebot_plugin_random_stereotypes\n```\n\n## \ud83d\udd27 \u914d\u7f6e\n\n|  \u914d\u7f6e\u9879   |     \u9ed8\u8ba4\u503c      |                        \u8bf4\u660e                         |\n|:------:|:------------:|:-------------------------------------------------:|\n|  stereotypes_cd   |     1800     | \u53d1\u75c5\u6b21\u6570\u8d85\u8fc7stereotypes_count\uff0c\u5219\u9700\u7b49\u5f85stereotypes_cd\u79d2\u540e\u624d\u53ef\u4ee5\u53d1\u75c5 |\n|  stereotypes_aliases  | [\"\u53d1\u7535\", \"\u53d1\u766b\"] |                      \u53ef\u9009\u6307\u4ee4\u524d\u7f00                       |\n| stereotypes_count |      3       |                    \u53ef\u8fde\u7eed\u53d1\u75c5\u7684\u6700\u5927\u6b21\u6570                     |\n| stereotypes_priority |     100      |                       \u63d2\u4ef6\u4f18\u5148\u7ea7                       |\n| stereotypes_block  |     False      |                  \u662f\u5426\u963b\u6b62\u4e8b\u4ef6\u5411\u4f4e\u4f18\u5148\u7ea7\u63d2\u4ef6\u4f20\u9012                  |\n\n\n## \ud83c\udf89 \u529f\u80fd\n\n\u968f\u673a\u751f\u6210\u4e0b\u6807\u83b7\u53d6\u672c\u5730`data.py`\u4e2d\u7684\u4e00\u6761\u8bed\u5f55\uff0c\u51ed\u501f\u4f20\u5165\u7684\u5b57\u7b26\u4e32\u8fd4\u56de\u7ed3\u679c\u3002\n\n## \ud83d\udc49 \u547d\u4ee4\n\n### /\u53d1\u75c5\n\n\u547d\u4ee4\u7ed3\u6784\uff1a```/\u53d1\u75c5 [\u53d1\u75c5\u5bf9\u8c61]```  \n\u4f8b\u5982\uff1a```/\u53d1\u75c5 \u6d4b\u8bd5```  \nbot\u8fd4\u56de\u5185\u5bb9\uff1a  \n`\u7535\u68af\u91cc\u9047\u5230\u4e86\u6d4b\u8bd5\uff0c\u5979\u6309\u4e86\u516b\u5c42\uff0c\u5475\u771f\u4f1a\u6697\u793a\uff0c\u5979\u516b\u5c42\u6709\u70b9\u559c\u6b22\u6211`  \n\n## \u2699 \u62d3\u5c55\n\n\u81ea\u5b9a\u4e49\u53d1\u75c5\u8bed\u5f55\uff0c\u4fee\u6539`data.py`\u6587\u4ef6\uff0c\u5728\u6570\u7ec4\u4e2d\u6dfb\u52a0\u8bed\u53e5\u5373\u53ef\uff0c\u5bf9\u8c61\u540d\u7528 `{target_name}` \u4ee3\u66ff\uff0c\u6ce8\u610f\u683c\u5f0f\uff01  \n\n## \ud83d\udcdd \u66f4\u65b0\u65e5\u5fd7\n\n<details>\n<summary>\u5c55\u5f00/\u6536\u8d77</summary>\n\n### 0.0.1\n\n- \u63d2\u4ef6\u521d\u6b21\u53d1\u5e03  \n\n### 0.0.2\n\n- \u8ffd\u52a0\u53d1\u75c5\u8bed\u5f55\u6570\u636e  \n\n### 0.2.1\n\n- \u8ffd\u52a0\u53d1\u75c5\u8bed\u5f55\u6570\u636e  \n\n</details>\n\n## \ud83d\udd27 \u5f00\u53d1\u73af\u5883\n\nNonebot2\uff1a2.0.0rc3  \npython\uff1a3.8.13  \n\u64cd\u4f5c\u7cfb\u7edf\uff1aWindows10\uff08Linux\u517c\u5bb9\u6027\u95ee\u9898\u4e0d\u5927\uff09  \n\u7f16\u8f91\u5668\uff1aVS Code  \n\n## \u81f4\u8c22\n\n- [nonebot-plugin-template](https://github.com/A-kirami/nonebot-plugin-template)\n\n## \u9879\u76ee\u6253\u5305\u4e0a\u4f20\u81f3pypi\n\n\u5b98\u7f51\uff1ahttps://pypi.org\uff0c\u6ce8\u518c\u8d26\u53f7\uff0c\u5728\u7cfb\u7edf\u7528\u6237\u6839\u76ee\u5f55\u4e0b\u521b\u5efa`.pypirc`\uff0c\u914d\u7f6e\n\n```txt\n[distutils] \nindex-servers=pypi \n \n[pypi] repository = https://upload.pypi.org/legacy/ \nusername = \u7528\u6237\u540d \npassword = \u5bc6\u7801\n```\n\n### poetry\n\n```sh\n# \u53c2\u8003 https://www.freesion.com/article/58051228882/\n# poetry config pypi-token.pypi\n\n# 1\u3001\u5b89\u88c5poetry\npip install poetry\n\n# 2\u3001\u521d\u59cb\u5316\u914d\u7f6e\u6587\u4ef6\uff08\u6839\u636e\u63d0\u793a\u586b\u5199\uff09\npoetry init\n\n# 3\u3001\u5fae\u8c03\u914d\u7f6e\u6587\u4ef6pyproject.toml\n\n# 4\u3001\u8fd0\u884c poetry install, \u53ef\u751f\u6210 \u201cpoetry.lock\u201d \u6587\u4ef6\uff08\u53ef\u8df3\u8fc7\uff09\npoetry install\n\n# 5\u3001\u7f16\u8bd1\uff0c\u751f\u6210dist\npoetry build\n\n# 6\u3001\u53d1\u5e03(poetry config pypi-token.pypi \u914d\u7f6etoken)\npoetry publish\n```\n\n### twine\n\n```sh\n# \u53c2\u8003 https://www.cnblogs.com/danhuai/p/14915042.html\n#\u521b\u5efasetup.py\u6587\u4ef6 \u586b\u5199\u76f8\u5173\u4fe1\u606f\n\n# 1\u3001\u53ef\u4ee5\u5148\u5347\u7ea7\u6253\u5305\u5de5\u5177\npip install --upgrade setuptools wheel twine\n\n# 2\u3001\u6253\u5305\npython setup.py sdist bdist_wheel\n\n# 3\u3001\u53ef\u4ee5\u5148\u68c0\u67e5\u4e00\u4e0b\u5305\ntwine check dist/*\n\n# 4\u3001\u4e0a\u4f20\u5305\u5230pypi\uff08\u9700\u8f93\u5165\u7528\u6237\u540d\u3001\u5bc6\u7801\uff09\ntwine upload dist/*\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "\u57fa\u4e8eNonebot2\u7684\u53d1\u75c5\u8bed\u5f55\u63d2\u4ef6",
    "version": "0.2.1",
    "project_urls": {
        "Documentation": "https://github.com/Ikaros-521/nonebot_plugin_random_stereotypes/blob/master/README.md",
        "Homepage": "https://github.com/Ikaros-521/nonebot_plugin_random_stereotypes",
        "Repository": "https://github.com/Ikaros-521/nonebot_plugin_random_stereotypes"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7b9f544f0a440d01ad51141e02c28fce72c6ddb91d84188bd2eea43f9e4d3a09",
                "md5": "3a42548db2091279eaac230f38299d81",
                "sha256": "371459451c1902381d7334c8e8fdb4e4f1b8aa235864a8663b30fc6c10cda64b"
            },
            "downloads": -1,
            "filename": "nonebot_plugin_random_stereotypes-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3a42548db2091279eaac230f38299d81",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 101154,
            "upload_time": "2024-08-24T13:51:02",
            "upload_time_iso_8601": "2024-08-24T13:51:02.338803Z",
            "url": "https://files.pythonhosted.org/packages/7b/9f/544f0a440d01ad51141e02c28fce72c6ddb91d84188bd2eea43f9e4d3a09/nonebot_plugin_random_stereotypes-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8b0115c5c1f2c6d2ff87503055a5d6843aa62c5cd9a50de814ab53e259b019c9",
                "md5": "b46a262d7fa1d86d91aa1c3736bc6ab2",
                "sha256": "212a984305a1bb7b7d62947980e2a822c55ac90a711920ce06b5528220f6dc6b"
            },
            "downloads": -1,
            "filename": "nonebot_plugin_random_stereotypes-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "b46a262d7fa1d86d91aa1c3736bc6ab2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 100791,
            "upload_time": "2024-08-24T13:51:04",
            "upload_time_iso_8601": "2024-08-24T13:51:04.208554Z",
            "url": "https://files.pythonhosted.org/packages/8b/01/15c5c1f2c6d2ff87503055a5d6843aa62c5cd9a50de814ab53e259b019c9/nonebot_plugin_random_stereotypes-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-24 13:51:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Ikaros-521",
    "github_project": "nonebot_plugin_random_stereotypes",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "nonebot_plugin_random_stereotypes"
}
        
Elapsed time: 0.36959s