<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-person
_✨ Nonebot2 简易插件随个人,随个群友当幸运观众🤪 ✨_
<a href="./LICENSE">
<img src="https://img.shields.io/github/license/jcjrobert/nonebot-plugin-person.svg" alt="license">
</a>
<a href="https://pypi.python.org/pypi/nonebot-plugin-person">
<img src="https://img.shields.io/pypi/v/nonebot-plugin-person.svg" alt="pypi">
</a>
<img src="https://img.shields.io/badge/python-3.8+-blue.svg" alt="python">
</div>
## 💿 安装
<details>
<summary>使用 nb-cli 安装</summary>
在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
nb plugin install nonebot-plugin-person
</details>
<details>
<summary>使用包管理器安装</summary>
在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
<details>
<summary>pip</summary>
pip install nonebot-plugin-person
</details>
<details>
<summary>pdm</summary>
pdm add nonebot-plugin-person
</details>
<details>
<summary>poetry</summary>
poetry add nonebot-plugin-person
</details>
<details>
<summary>conda</summary>
conda install nonebot-plugin-person
</details>
打开 nonebot2 项目的 `bot.py` 文件, 在其中写入
nonebot.load_plugin('nonebot-plugin-person')
</details>
<details>
<summary>从 github 安装</summary>
在 nonebot2 项目的插件目录下, 打开命令行, 输入以下命令克隆此储存库
git clone https://github.com/jcjrobert/nonebot-plugin-person.git
打开 nonebot2 项目的 `bot.py` 文件, 在其中写入
nonebot.load_plugin('src.plugins.nonebot-plugin-person')
</details>
## ⚙️ 配置
可在 nonebot2 项目的`.env`文件中添加下表中的配置
| 配置项 | 必填 | 默认值 | 说明 |
|:-----:|:----:|:----:|:----:|
| person_show_avatar | 否 | true | 是否显示头像,默认显示 |
| person_extra_messages | 否 | [] | 自定义文案,{name}会替换成Bot昵称,{person}会替换成抽到的人的信息,没有这两项依然能展示 |
| person_extra_messages_overwrite | 否 | false | 自定义文案是否覆盖已有文案,默认不覆盖 |
| person_at | 否 | false | 是否at随人对象,将会替换QQ号放在消息结尾 |
| person_choose_last | 否 | false | 是否仅抽取最近发言的群友,默认否 |
| person_choose_last_time | 否 | 2592000 | 最近发言时间范围,默认为2592000(30天) |
| person_check_last | 否 | false | 日志打印,用于检查群友最近发言时间 |
注意,不要将最近发言时间范围设置的太短,因为API获取到的最近发言时间戳经测试并不同步,如果有更好的方案欢迎提出issue或pr
## 🎉 使用
随个人
随个人帮我打代码
随个人XXX
...
## 📝 更新日志
<details>
<summary>展开/收起</summary>
### 0.0.5
- 支持仅抽取最近发言的群友
### 0.0.4
- 修复机器人昵称配置为空时报错的BUG
### 0.0.3
- 支持AT随人对象
### 0.0.2
- 支持头像显示
- 支持自定义文案,同时支持是否覆盖原文案
### 0.0.1
- 插件初次发布
</details>
## 开源许可
本项目使用[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/jcjrobert/nonebot-plugin-person",
"name": "nonebot-plugin-person",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "pip,nonebot2,nonebot,\u968f\u4e2a\u4eba",
"author": "jcjrobert",
"author_email": "jcjrobbie@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/a6/fa/8a8ccea095f46862732c8eb0a7a96dc4f824b4e81c57f4950ea449e22c68/nonebot-plugin-person-0.0.5.tar.gz",
"platform": "any",
"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-person\n\n_\u2728 Nonebot2 \u7b80\u6613\u63d2\u4ef6\u968f\u4e2a\u4eba\uff0c\u968f\u4e2a\u7fa4\u53cb\u5f53\u5e78\u8fd0\u89c2\u4f17\ud83e\udd2a \u2728_\n\n\n<a href=\"./LICENSE\">\n <img src=\"https://img.shields.io/github/license/jcjrobert/nonebot-plugin-person.svg\" alt=\"license\">\n</a>\n<a href=\"https://pypi.python.org/pypi/nonebot-plugin-person\">\n <img src=\"https://img.shields.io/pypi/v/nonebot-plugin-person.svg\" alt=\"pypi\">\n</a>\n<img src=\"https://img.shields.io/badge/python-3.8+-blue.svg\" alt=\"python\">\n\n</div>\n\n## \ud83d\udcbf \u5b89\u88c5\n\n<details>\n<summary>\u4f7f\u7528 nb-cli \u5b89\u88c5</summary>\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-person\n\n</details>\n\n<details>\n<summary>\u4f7f\u7528\u5305\u7ba1\u7406\u5668\u5b89\u88c5</summary>\n\u5728 nonebot2 \u9879\u76ee\u7684\u63d2\u4ef6\u76ee\u5f55\u4e0b, \u6253\u5f00\u547d\u4ee4\u884c, \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-person\n</details>\n<details>\n<summary>pdm</summary>\n\n pdm add nonebot-plugin-person\n</details>\n<details>\n<summary>poetry</summary>\n\n poetry add nonebot-plugin-person\n</details>\n<details>\n<summary>conda</summary>\n\n conda install nonebot-plugin-person\n</details>\n\n\u6253\u5f00 nonebot2 \u9879\u76ee\u7684 `bot.py` \u6587\u4ef6, \u5728\u5176\u4e2d\u5199\u5165\n\n nonebot.load_plugin('nonebot-plugin-person')\n\n</details>\n\n<details>\n<summary>\u4ece github \u5b89\u88c5</summary>\n\u5728 nonebot2 \u9879\u76ee\u7684\u63d2\u4ef6\u76ee\u5f55\u4e0b, \u6253\u5f00\u547d\u4ee4\u884c, \u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u514b\u9686\u6b64\u50a8\u5b58\u5e93\n\n git clone https://github.com/jcjrobert/nonebot-plugin-person.git\n\n\u6253\u5f00 nonebot2 \u9879\u76ee\u7684 `bot.py` \u6587\u4ef6, \u5728\u5176\u4e2d\u5199\u5165\n\n nonebot.load_plugin('src.plugins.nonebot-plugin-person')\n\n</details>\n\n## \u2699\ufe0f \u914d\u7f6e\n\n\u53ef\u5728 nonebot2 \u9879\u76ee\u7684`.env`\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4e0b\u8868\u4e2d\u7684\u914d\u7f6e\n\n| \u914d\u7f6e\u9879 | \u5fc5\u586b | \u9ed8\u8ba4\u503c | \u8bf4\u660e |\n|:-----:|:----:|:----:|:----:|\n| person_show_avatar | \u5426 | true | \u662f\u5426\u663e\u793a\u5934\u50cf\uff0c\u9ed8\u8ba4\u663e\u793a |\n| person_extra_messages | \u5426 | [] | \u81ea\u5b9a\u4e49\u6587\u6848\uff0c{name}\u4f1a\u66ff\u6362\u6210Bot\u6635\u79f0\uff0c{person}\u4f1a\u66ff\u6362\u6210\u62bd\u5230\u7684\u4eba\u7684\u4fe1\u606f\uff0c\u6ca1\u6709\u8fd9\u4e24\u9879\u4f9d\u7136\u80fd\u5c55\u793a |\n| person_extra_messages_overwrite | \u5426 | false | \u81ea\u5b9a\u4e49\u6587\u6848\u662f\u5426\u8986\u76d6\u5df2\u6709\u6587\u6848\uff0c\u9ed8\u8ba4\u4e0d\u8986\u76d6 |\n| person_at | \u5426 | false | \u662f\u5426at\u968f\u4eba\u5bf9\u8c61\uff0c\u5c06\u4f1a\u66ff\u6362QQ\u53f7\u653e\u5728\u6d88\u606f\u7ed3\u5c3e |\n| person_choose_last | \u5426 | false | \u662f\u5426\u4ec5\u62bd\u53d6\u6700\u8fd1\u53d1\u8a00\u7684\u7fa4\u53cb\uff0c\u9ed8\u8ba4\u5426 |\n| person_choose_last_time | \u5426 | 2592000 | \u6700\u8fd1\u53d1\u8a00\u65f6\u95f4\u8303\u56f4\uff0c\u9ed8\u8ba4\u4e3a2592000\uff0830\u5929\uff09 |\n| person_check_last | \u5426 | false | \u65e5\u5fd7\u6253\u5370\uff0c\u7528\u4e8e\u68c0\u67e5\u7fa4\u53cb\u6700\u8fd1\u53d1\u8a00\u65f6\u95f4 |\n\n\u6ce8\u610f\uff0c\u4e0d\u8981\u5c06\u6700\u8fd1\u53d1\u8a00\u65f6\u95f4\u8303\u56f4\u8bbe\u7f6e\u7684\u592a\u77ed\uff0c\u56e0\u4e3aAPI\u83b7\u53d6\u5230\u7684\u6700\u8fd1\u53d1\u8a00\u65f6\u95f4\u6233\u7ecf\u6d4b\u8bd5\u5e76\u4e0d\u540c\u6b65\uff0c\u5982\u679c\u6709\u66f4\u597d\u7684\u65b9\u6848\u6b22\u8fce\u63d0\u51faissue\u6216pr\n\n## \ud83c\udf89 \u4f7f\u7528\n\n\u968f\u4e2a\u4eba\n\n\u968f\u4e2a\u4eba\u5e2e\u6211\u6253\u4ee3\u7801\n\n\u968f\u4e2a\u4ebaXXX\n\n...\n\n## \ud83d\udcdd \u66f4\u65b0\u65e5\u5fd7\n\n<details>\n<summary>\u5c55\u5f00/\u6536\u8d77</summary>\n\n### 0.0.5\n\n- \u652f\u6301\u4ec5\u62bd\u53d6\u6700\u8fd1\u53d1\u8a00\u7684\u7fa4\u53cb\n\n### 0.0.4\n\n- \u4fee\u590d\u673a\u5668\u4eba\u6635\u79f0\u914d\u7f6e\u4e3a\u7a7a\u65f6\u62a5\u9519\u7684BUG\n\n### 0.0.3\n\n- \u652f\u6301AT\u968f\u4eba\u5bf9\u8c61\n\n### 0.0.2\n\n- \u652f\u6301\u5934\u50cf\u663e\u793a\n- \u652f\u6301\u81ea\u5b9a\u4e49\u6587\u6848\uff0c\u540c\u65f6\u652f\u6301\u662f\u5426\u8986\u76d6\u539f\u6587\u6848\n\n### 0.0.1\n\n- \u63d2\u4ef6\u521d\u6b21\u53d1\u5e03\n\n</details>\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 License",
"summary": "Nonebot2 \u7b80\u6613\u63d2\u4ef6\u968f\u4e2a\u4eba\uff0c\u968f\u4e2a\u7fa4\u53cb\u5f53\u5e78\u8fd0\u89c2\u4f17\ud83e\udd2a",
"version": "0.0.5",
"split_keywords": [
"pip",
"nonebot2",
"nonebot",
"\u968f\u4e2a\u4eba"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "c5122fa7249499037de0cc409596ccf9",
"sha256": "178d6941447d67844d6db9a590d8c72cb02b7fef407a53d513c96b8f7a088ac5"
},
"downloads": -1,
"filename": "nonebot_plugin_person-0.0.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c5122fa7249499037de0cc409596ccf9",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 6138,
"upload_time": "2022-12-15T02:18:32",
"upload_time_iso_8601": "2022-12-15T02:18:32.344475Z",
"url": "https://files.pythonhosted.org/packages/6f/54/7460c6b516c53ae023549ab42ec3c73340825646df1e9b06e89e2b92639e/nonebot_plugin_person-0.0.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "439fa53f7782c17f54fe775bd9aa4687",
"sha256": "207e209df98f964824574b9a45ea87af811c562426fa10e401fc4e3267be5a0a"
},
"downloads": -1,
"filename": "nonebot-plugin-person-0.0.5.tar.gz",
"has_sig": false,
"md5_digest": "439fa53f7782c17f54fe775bd9aa4687",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5381,
"upload_time": "2022-12-15T02:18:34",
"upload_time_iso_8601": "2022-12-15T02:18:34.615570Z",
"url": "https://files.pythonhosted.org/packages/a6/fa/8a8ccea095f46862732c8eb0a7a96dc4f824b4e81c57f4950ea449e22c68/nonebot-plugin-person-0.0.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-12-15 02:18:34",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "jcjrobert",
"github_project": "nonebot-plugin-person",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "nonebot-plugin-person"
}