<div align="center">
<a href="https://nonebot.dev/">
<img src="https://nonebot.dev/logo.png" width="200" height="200" alt="nonebot">
</a>
# nonebot-plugin-memes
_✨ [Nonebot2](https://github.com/nonebot/nonebot2) 表情包制作插件 ✨_
<p align="center">
<img src="https://img.shields.io/github/license/noneplugin/nonebot-plugin-memes" alt="license">
<img src="https://img.shields.io/badge/python-3.9+-blue.svg" alt="Python">
<img src="https://img.shields.io/badge/nonebot-2.3.0+-red.svg" alt="NoneBot">
<a href="https://pypi.org/project/nonebot-plugin-memes">
<img src="https://badgen.net/pypi/v/nonebot-plugin-memes" alt="pypi">
</a>
<a href="https://jq.qq.com/?_wv=1027&k=wDVNrMdr">
<img src="https://img.shields.io/badge/QQ%E7%BE%A4-682145034-orange" alt="qq group">
</a>
</p>
</div>
> [!NOTE]
>
> 本插件负责处理聊天机器人相关逻辑,具体表情包制作相关资源文件和代码在 [表情包生成器 meme-generator](https://github.com/MeetWq/meme-generator) 中
>
> 可使用 [nonebot-plugin-memes-api](https://github.com/noneplugin/nonebot-plugin-memes-api)(表情包制作 调用 api 版本),将 NoneBot 插件端与 `meme-generator` 分开部署
>
> `nonebot-plugin-memes-api` 与 `nonebot-plugin-memes` 功能上基本一致
### 安装
- 使用 nb-cli
```
nb plugin install nonebot_plugin_memes
```
- 使用 pip
```
pip install nonebot_plugin_memes
```
并按照 [NoneBot 加载插件](https://nonebot.dev/docs/tutorial/create-plugin#加载插件) 加载插件
#### 配置驱动器
插件需要“客户端型驱动器”(如 httpx)来下载图片等,驱动器安装和配置参考 [NoneBot 选择驱动器](https://nonebot.dev/docs/advanced/driver)
同时需要在 `.env.*` 配置文件中启用对应的驱动器,例如:
```
DRIVER=~fastapi+~httpx+~websockets
```
#### 字体和资源
插件默认在启动时会检查 [meme-generator](https://github.com/MeetWq/meme-generator) 所需的图片资源
需按照 [meme-generator 字体安装](https://github.com/MeetWq/meme-generator/wiki/本地安装#字体安装) 自行安装字体
##### 字体显示不正常解决流程
- 检查字体是否安装完整
需要**手动安装字体**到系统中,详情请参考 [meme-generator 字体安装](https://github.com/MeetWq/meme-generator/wiki/本地安装#字体安装)
- 删除表情列表图片缓存
插件会缓存生成的表情列表图片以避免重复生成,若因为字体没安装好等原因导致生成的图片不正常,需要删除缓存的图片
缓存图片存放在 [nonebot-plugin-localstore](https://github.com/nonebot/plugin-localstore) 插件定义的缓存目录下
> 默认缓存目录位置:
>
> - Windows: `C:\Users\<username>\AppData\Local\nonebot2\Cache\nonebot_plugin_memes`
> - Linux: `~/.cache/nonebot2/nonebot_plugin_memes`
> - Mac: `~/Library/Caches/nonebot2/nonebot_plugin_memes`
### 配置项
> 以下配置项可在 `.env.*` 文件中设置,具体参考 [NoneBot 配置方式](https://nonebot.dev/docs/appendices/config)
#### `memes_command_prefixes`
- 类型:`List[str] | None`
- 默认:`None`
- 说明:命令前缀(仅作用于制作表情的命令);如果不设置默认使用 [NoneBot 命令前缀](https://nonebot.dev/docs/appendices/config#command-start-和-command-separator)
#### `memes_disabled_list`
- 类型:`List[str]`
- 默认:`[]`
- 说明:禁用的表情包列表,需填写表情的`key`,可在 [meme-generator 表情列表](https://github.com/MeetWq/meme-generator/wiki/表情列表) 中查看。若只是临时关闭,可以用下文中的“表情包开关”
#### `memes_check_resources_on_startup`
- 类型:`bool`
- 默认:`True`
- 说明:是否在启动时检查 `meme-generator` 资源
#### `memes_prompt_params_error`
- 类型:`bool`
- 默认:`False`
- 说明:是否在图片/文字数量不符时提示(谨慎使用,容易误触发)
#### `memes_use_sender_when_no_image`
- 类型:`bool`
- 默认:`False`
- 说明:在表情需要至少1张图且没有输入图片时,是否使用发送者的头像(谨慎使用,容易误触发)
#### `memes_use_default_when_no_text`
- 类型:`bool`
- 默认:`False`
- 说明:在表情需要至少1段文字且没有输入文字时,是否使用默认文字(谨慎使用,容易误触发)
#### `memes_random_meme_show_info`
- 类型:`bool`
- 默认:`True`
- 说明:使用“随机表情”时是否同时发出表情关键词
#### `memes_list_image_config`
- 类型:`MemeListImageConfig`
- 说明:表情列表图相关设置,其中具体设置项如下:
- `sort_by`
- 类型:`str`
- 默认:`"keywords"`
- 说明:表情排序方式,可用值:`"key"`(按表情 `key` 排序)、`"keywords"`(按表情首个关键词排序)、`"date_created"`(按表情添加时间排序)、`"date_modified"`(按表情修改时间排序)
- `sort_reverse`
- 类型:`bool`
- 默认:`False`
- 说明:是否倒序排序
- `text_template`
- 类型:`str`
- 默认:`"{keywords}"`
- 说明:表情显示文字模板,可用变量:`"{index}"`(序号)、`"{key}"`(表情名)、`"{keywords}"`(关键词)、`"{shortcuts}"`(快捷指令)、`"{tags}"`(标签)
- `add_category_icon`
- 类型:`bool`
- 默认:`True`
- 说明:是否添加图标以表示类型,即“图片表情包”和“文字表情包”
- `label_new_timedelta`
- 类型:`timedelta`
- 默认:`timedelta(days=30)`
- 说明:表情添加时间在该时间间隔以内时,添加 `new` 图标
- `label_hot_threshold`
- 类型:`int`
- 默认:`21`
- 说明:单位:次;表情在 `label_hot_days` 内的调用次数超过该阈值时,添加 `hot` 图标
- `label_hot_days`
- 类型:`int`
- 默认:`7`
- 说明:单位:天;表情调用次数统计周期
- `memes_list_image_config` 在 `.env` 文件中的设置示例如下:
```
memes_list_image_config='
{
"sort_by": "keywords",
"sort_reverse": false,
"text_template": "{keywords}",
"add_category_icon": true,
"label_new_timedelta": "P30D",
"label_hot_threshold": 21,
"label_hot_days": 7
}
'
```
### 使用
**以下命令需要加 [NoneBot 命令前缀](https://nonebot.dev/docs/appendices/config#command-start-和-command-separator) (默认为`/`),可自行添加空字符**
#### 表情列表
- 发送 “表情包制作” 查看表情列表
#### 表情详情
- 发送 “表情详情 + 表情名/关键词” 查看表情详细信息和表情预览
#### 表情搜索
- 发送 “表情搜索 + 关键词” 查找相关的表情
#### 表情包开关
“超级用户” 和 “管理员” 可以启用或禁用某些表情包
- 发送 `启用表情/禁用表情 表情名/关键词`,如:`禁用表情 摸`
“超级用户” 可以设置某个表情包的管控模式(黑名单/白名单)
- 发送 `全局启用表情 表情名/关键词` 可将表情设为黑名单模式;
- 发送 `全局禁用表情 表情名/关键词` 可将表情设为白名单模式;
> [!NOTE]
>
> “超级用户” 可通过 [NoneBot SuperUsers](https://nonebot.dev/docs/appendices/config#superusers) 设置
>
> “管理员” 目前包括:OneBot V11 适配器中的群主、管理员
#### 表情使用
- 发送 “关键词 + 图片/文字” 制作表情
可使用 “自己”、“@某人” 获取指定用户的头像作为图片
可使用 “@ + 用户id” 指定任意用户获取头像,如 “摸 @114514”
可将回复中的消息作为文字和图片的输入
示例:
<div align="left">
<img src="https://s2.loli.net/2023/03/10/UDTOuPnwk3emxv4.png" width="250" />
</div>
> [!NOTE]
>
> - 为避免误触发,当输入的 图片/文字 数量不符时,默认不会进行提示,可通过 `memes_prompt_params_error` 配置项进行设置
> - 本插件通过 [nonebot-plugin-userinfo](https://github.com/noneplugin/nonebot-plugin-userinfo) 插件获取用户名和用户头像,具体平台支持范围可前往该插件查看
> - 本插件通过 [nonebot-plugin-alconna](https://github.com/nonebot/plugin-alconna) 来实现多适配器消息接收、获取图片输入、获取回复内容等,相关问题可前往该插件查看
#### 随机表情
- 发送 “随机表情 + 图片/文字” 可随机制作表情
随机范围为 图片/文字 数量符合要求的表情
#### 表情调用统计
- 发送 “[我的][全局]<时间段>表情调用统计 [表情名]” 获取表情调用次数统计图
“我的”、“全局”、<时间段>、“表情名” 均为可选项
<时间段> 的关键词有:日、本日、周、本周、月、本月、年、本年
如:“我的今日表情调用统计 petpet”
### 相关插件
- [nonebot-plugin-send-anything-anywhere](https://github.com/felinae98/nonebot-plugin-send-anything-anywhere) 一个帮助处理不同 adapter 消息的适配和发送的插件
- [nonebot-plugin-alconna](https://github.com/nonebot/plugin-alconna) 强大的 Nonebot2 命令匹配拓展,支持富文本/多媒体解析,跨平台消息收发
- [nonebot-plugin-session](https://github.com/noneplugin/nonebot-plugin-session) Nonebot2 会话信息提取与会话 id 定义插件
- [nonebot-plugin-userinfo](https://github.com/noneplugin/nonebot-plugin-userinfo) Nonebot2 用户信息获取插件
Raw data
{
"_id": null,
"home_page": "https://github.com/noneplugin/nonebot-plugin-memes",
"name": "nonebot_plugin_memes",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": null,
"author": "meetwq",
"author_email": "meetwq@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/b5/67/aa3ebc0562a20c440efbb4b2592fb0d9551e8e0aad4df6682ad76c5ba647/nonebot_plugin_memes-0.7.12.tar.gz",
"platform": null,
"description": "<div align=\"center\">\n\n <a href=\"https://nonebot.dev/\">\n <img src=\"https://nonebot.dev/logo.png\" width=\"200\" height=\"200\" alt=\"nonebot\">\n </a>\n\n# nonebot-plugin-memes\n\n_\u2728 [Nonebot2](https://github.com/nonebot/nonebot2) \u8868\u60c5\u5305\u5236\u4f5c\u63d2\u4ef6 \u2728_\n\n<p align=\"center\">\n <img src=\"https://img.shields.io/github/license/noneplugin/nonebot-plugin-memes\" alt=\"license\">\n <img src=\"https://img.shields.io/badge/python-3.9+-blue.svg\" alt=\"Python\">\n <img src=\"https://img.shields.io/badge/nonebot-2.3.0+-red.svg\" alt=\"NoneBot\">\n <a href=\"https://pypi.org/project/nonebot-plugin-memes\">\n <img src=\"https://badgen.net/pypi/v/nonebot-plugin-memes\" alt=\"pypi\">\n </a>\n <a href=\"https://jq.qq.com/?_wv=1027&k=wDVNrMdr\">\n <img src=\"https://img.shields.io/badge/QQ%E7%BE%A4-682145034-orange\" alt=\"qq group\">\n </a>\n</p>\n\n</div>\n\n> [!NOTE]\n>\n> \u672c\u63d2\u4ef6\u8d1f\u8d23\u5904\u7406\u804a\u5929\u673a\u5668\u4eba\u76f8\u5173\u903b\u8f91\uff0c\u5177\u4f53\u8868\u60c5\u5305\u5236\u4f5c\u76f8\u5173\u8d44\u6e90\u6587\u4ef6\u548c\u4ee3\u7801\u5728 [\u8868\u60c5\u5305\u751f\u6210\u5668 meme-generator](https://github.com/MeetWq/meme-generator) \u4e2d\n>\n> \u53ef\u4f7f\u7528 [nonebot-plugin-memes-api](https://github.com/noneplugin/nonebot-plugin-memes-api)\uff08\u8868\u60c5\u5305\u5236\u4f5c \u8c03\u7528 api \u7248\u672c\uff09\uff0c\u5c06 NoneBot \u63d2\u4ef6\u7aef\u4e0e `meme-generator` \u5206\u5f00\u90e8\u7f72\n>\n> `nonebot-plugin-memes-api` \u4e0e `nonebot-plugin-memes` \u529f\u80fd\u4e0a\u57fa\u672c\u4e00\u81f4\n\n### \u5b89\u88c5\n\n- \u4f7f\u7528 nb-cli\n\n```\nnb plugin install nonebot_plugin_memes\n```\n\n- \u4f7f\u7528 pip\n\n```\npip install nonebot_plugin_memes\n```\n\n\u5e76\u6309\u7167 [NoneBot \u52a0\u8f7d\u63d2\u4ef6](https://nonebot.dev/docs/tutorial/create-plugin#\u52a0\u8f7d\u63d2\u4ef6) \u52a0\u8f7d\u63d2\u4ef6\n\n#### \u914d\u7f6e\u9a71\u52a8\u5668\u200b\n\n\u63d2\u4ef6\u9700\u8981\u201c\u5ba2\u6237\u7aef\u578b\u9a71\u52a8\u5668\u201d\uff08\u5982 httpx\uff09\u6765\u4e0b\u8f7d\u56fe\u7247\u7b49\uff0c\u9a71\u52a8\u5668\u5b89\u88c5\u548c\u914d\u7f6e\u53c2\u8003 [NoneBot \u9009\u62e9\u9a71\u52a8\u5668](https://nonebot.dev/docs/advanced/driver)\n\n\u540c\u65f6\u9700\u8981\u5728 `.env.*` \u914d\u7f6e\u6587\u4ef6\u4e2d\u542f\u7528\u5bf9\u5e94\u7684\u9a71\u52a8\u5668\uff0c\u4f8b\u5982\uff1a\n\n```\nDRIVER=~fastapi+~httpx+~websockets\n```\n\n#### \u5b57\u4f53\u548c\u8d44\u6e90\n\n\u63d2\u4ef6\u9ed8\u8ba4\u5728\u542f\u52a8\u65f6\u4f1a\u68c0\u67e5 [meme-generator](https://github.com/MeetWq/meme-generator) \u6240\u9700\u7684\u56fe\u7247\u8d44\u6e90\n\n\u9700\u6309\u7167 [meme-generator \u5b57\u4f53\u5b89\u88c5](https://github.com/MeetWq/meme-generator/wiki/\u672c\u5730\u5b89\u88c5#\u5b57\u4f53\u5b89\u88c5) \u81ea\u884c\u5b89\u88c5\u5b57\u4f53\n\n##### \u5b57\u4f53\u663e\u793a\u4e0d\u6b63\u5e38\u89e3\u51b3\u6d41\u7a0b\n\n- \u68c0\u67e5\u5b57\u4f53\u662f\u5426\u5b89\u88c5\u5b8c\u6574\n\n\u9700\u8981**\u624b\u52a8\u5b89\u88c5\u5b57\u4f53**\u5230\u7cfb\u7edf\u4e2d\uff0c\u8be6\u60c5\u8bf7\u53c2\u8003 [meme-generator \u5b57\u4f53\u5b89\u88c5](https://github.com/MeetWq/meme-generator/wiki/\u672c\u5730\u5b89\u88c5#\u5b57\u4f53\u5b89\u88c5)\n\n- \u5220\u9664\u8868\u60c5\u5217\u8868\u56fe\u7247\u7f13\u5b58\n\n\u63d2\u4ef6\u4f1a\u7f13\u5b58\u751f\u6210\u7684\u8868\u60c5\u5217\u8868\u56fe\u7247\u4ee5\u907f\u514d\u91cd\u590d\u751f\u6210\uff0c\u82e5\u56e0\u4e3a\u5b57\u4f53\u6ca1\u5b89\u88c5\u597d\u7b49\u539f\u56e0\u5bfc\u81f4\u751f\u6210\u7684\u56fe\u7247\u4e0d\u6b63\u5e38\uff0c\u9700\u8981\u5220\u9664\u7f13\u5b58\u7684\u56fe\u7247\n\n\u7f13\u5b58\u56fe\u7247\u5b58\u653e\u5728 [nonebot-plugin-localstore](https://github.com/nonebot/plugin-localstore) \u63d2\u4ef6\u5b9a\u4e49\u7684\u7f13\u5b58\u76ee\u5f55\u4e0b\n\n> \u9ed8\u8ba4\u7f13\u5b58\u76ee\u5f55\u4f4d\u7f6e\uff1a\n>\n> - Windows: `C:\\Users\\<username>\\AppData\\Local\\nonebot2\\Cache\\nonebot_plugin_memes`\n> - Linux: `~/.cache/nonebot2/nonebot_plugin_memes`\n> - Mac: `~/Library/Caches/nonebot2/nonebot_plugin_memes`\n\n### \u914d\u7f6e\u9879\n\n> \u4ee5\u4e0b\u914d\u7f6e\u9879\u53ef\u5728 `.env.*` \u6587\u4ef6\u4e2d\u8bbe\u7f6e\uff0c\u5177\u4f53\u53c2\u8003 [NoneBot \u914d\u7f6e\u65b9\u5f0f](https://nonebot.dev/docs/appendices/config)\n\n#### `memes_command_prefixes`\n\n- \u7c7b\u578b\uff1a`List[str] | None`\n- \u9ed8\u8ba4\uff1a`None`\n- \u8bf4\u660e\uff1a\u547d\u4ee4\u524d\u7f00\uff08\u4ec5\u4f5c\u7528\u4e8e\u5236\u4f5c\u8868\u60c5\u7684\u547d\u4ee4\uff09\uff1b\u5982\u679c\u4e0d\u8bbe\u7f6e\u9ed8\u8ba4\u4f7f\u7528 [NoneBot \u547d\u4ee4\u524d\u7f00](https://nonebot.dev/docs/appendices/config#command-start-\u548c-command-separator)\n\n#### `memes_disabled_list`\n\n- \u7c7b\u578b\uff1a`List[str]`\n- \u9ed8\u8ba4\uff1a`[]`\n- \u8bf4\u660e\uff1a\u7981\u7528\u7684\u8868\u60c5\u5305\u5217\u8868\uff0c\u9700\u586b\u5199\u8868\u60c5\u7684`key`\uff0c\u53ef\u5728 [meme-generator \u8868\u60c5\u5217\u8868](https://github.com/MeetWq/meme-generator/wiki/\u8868\u60c5\u5217\u8868) \u4e2d\u67e5\u770b\u3002\u82e5\u53ea\u662f\u4e34\u65f6\u5173\u95ed\uff0c\u53ef\u4ee5\u7528\u4e0b\u6587\u4e2d\u7684\u201c\u8868\u60c5\u5305\u5f00\u5173\u201d\n\n#### `memes_check_resources_on_startup`\n\n- \u7c7b\u578b\uff1a`bool`\n- \u9ed8\u8ba4\uff1a`True`\n- \u8bf4\u660e\uff1a\u662f\u5426\u5728\u542f\u52a8\u65f6\u68c0\u67e5 `meme-generator` \u8d44\u6e90\n\n#### `memes_prompt_params_error`\n\n- \u7c7b\u578b\uff1a`bool`\n- \u9ed8\u8ba4\uff1a`False`\n- \u8bf4\u660e\uff1a\u662f\u5426\u5728\u56fe\u7247/\u6587\u5b57\u6570\u91cf\u4e0d\u7b26\u65f6\u63d0\u793a\uff08\u8c28\u614e\u4f7f\u7528\uff0c\u5bb9\u6613\u8bef\u89e6\u53d1\uff09\n\n#### `memes_use_sender_when_no_image`\n\n- \u7c7b\u578b\uff1a`bool`\n- \u9ed8\u8ba4\uff1a`False`\n- \u8bf4\u660e\uff1a\u5728\u8868\u60c5\u9700\u8981\u81f3\u5c111\u5f20\u56fe\u4e14\u6ca1\u6709\u8f93\u5165\u56fe\u7247\u65f6\uff0c\u662f\u5426\u4f7f\u7528\u53d1\u9001\u8005\u7684\u5934\u50cf\uff08\u8c28\u614e\u4f7f\u7528\uff0c\u5bb9\u6613\u8bef\u89e6\u53d1\uff09\n\n#### `memes_use_default_when_no_text`\n\n- \u7c7b\u578b\uff1a`bool`\n- \u9ed8\u8ba4\uff1a`False`\n- \u8bf4\u660e\uff1a\u5728\u8868\u60c5\u9700\u8981\u81f3\u5c111\u6bb5\u6587\u5b57\u4e14\u6ca1\u6709\u8f93\u5165\u6587\u5b57\u65f6\uff0c\u662f\u5426\u4f7f\u7528\u9ed8\u8ba4\u6587\u5b57\uff08\u8c28\u614e\u4f7f\u7528\uff0c\u5bb9\u6613\u8bef\u89e6\u53d1\uff09\n\n#### `memes_random_meme_show_info`\n\n- \u7c7b\u578b\uff1a`bool`\n- \u9ed8\u8ba4\uff1a`True`\n- \u8bf4\u660e\uff1a\u4f7f\u7528\u201c\u968f\u673a\u8868\u60c5\u201d\u65f6\u662f\u5426\u540c\u65f6\u53d1\u51fa\u8868\u60c5\u5173\u952e\u8bcd\n\n#### `memes_list_image_config`\n\n- \u7c7b\u578b\uff1a`MemeListImageConfig`\n- \u8bf4\u660e\uff1a\u8868\u60c5\u5217\u8868\u56fe\u76f8\u5173\u8bbe\u7f6e\uff0c\u5176\u4e2d\u5177\u4f53\u8bbe\u7f6e\u9879\u5982\u4e0b\uff1a\n - `sort_by`\n - \u7c7b\u578b\uff1a`str`\n - \u9ed8\u8ba4\uff1a`\"keywords\"`\n - \u8bf4\u660e\uff1a\u8868\u60c5\u6392\u5e8f\u65b9\u5f0f\uff0c\u53ef\u7528\u503c\uff1a`\"key\"`\uff08\u6309\u8868\u60c5 `key` \u6392\u5e8f\uff09\u3001`\"keywords\"`\uff08\u6309\u8868\u60c5\u9996\u4e2a\u5173\u952e\u8bcd\u6392\u5e8f\uff09\u3001`\"date_created\"`\uff08\u6309\u8868\u60c5\u6dfb\u52a0\u65f6\u95f4\u6392\u5e8f\uff09\u3001`\"date_modified\"`\uff08\u6309\u8868\u60c5\u4fee\u6539\u65f6\u95f4\u6392\u5e8f\uff09\n - `sort_reverse`\n - \u7c7b\u578b\uff1a`bool`\n - \u9ed8\u8ba4\uff1a`False`\n - \u8bf4\u660e\uff1a\u662f\u5426\u5012\u5e8f\u6392\u5e8f\n - `text_template`\n - \u7c7b\u578b\uff1a`str`\n - \u9ed8\u8ba4\uff1a`\"{keywords}\"`\n - \u8bf4\u660e\uff1a\u8868\u60c5\u663e\u793a\u6587\u5b57\u6a21\u677f\uff0c\u53ef\u7528\u53d8\u91cf\uff1a`\"{index}\"`\uff08\u5e8f\u53f7\uff09\u3001`\"{key}\"`\uff08\u8868\u60c5\u540d\uff09\u3001`\"{keywords}\"`\uff08\u5173\u952e\u8bcd\uff09\u3001`\"{shortcuts}\"`\uff08\u5feb\u6377\u6307\u4ee4\uff09\u3001`\"{tags}\"`\uff08\u6807\u7b7e\uff09\n - `add_category_icon`\n - \u7c7b\u578b\uff1a`bool`\n - \u9ed8\u8ba4\uff1a`True`\n - \u8bf4\u660e\uff1a\u662f\u5426\u6dfb\u52a0\u56fe\u6807\u4ee5\u8868\u793a\u7c7b\u578b\uff0c\u5373\u201c\u56fe\u7247\u8868\u60c5\u5305\u201d\u548c\u201c\u6587\u5b57\u8868\u60c5\u5305\u201d\n - `label_new_timedelta`\n - \u7c7b\u578b\uff1a`timedelta`\n - \u9ed8\u8ba4\uff1a`timedelta(days=30)`\n - \u8bf4\u660e\uff1a\u8868\u60c5\u6dfb\u52a0\u65f6\u95f4\u5728\u8be5\u65f6\u95f4\u95f4\u9694\u4ee5\u5185\u65f6\uff0c\u6dfb\u52a0 `new` \u56fe\u6807\n - `label_hot_threshold`\n - \u7c7b\u578b\uff1a`int`\n - \u9ed8\u8ba4\uff1a`21`\n - \u8bf4\u660e\uff1a\u5355\u4f4d\uff1a\u6b21\uff1b\u8868\u60c5\u5728 `label_hot_days` \u5185\u7684\u8c03\u7528\u6b21\u6570\u8d85\u8fc7\u8be5\u9608\u503c\u65f6\uff0c\u6dfb\u52a0 `hot` \u56fe\u6807\n - `label_hot_days`\n - \u7c7b\u578b\uff1a`int`\n - \u9ed8\u8ba4\uff1a`7`\n - \u8bf4\u660e\uff1a\u5355\u4f4d\uff1a\u5929\uff1b\u8868\u60c5\u8c03\u7528\u6b21\u6570\u7edf\u8ba1\u5468\u671f\n- `memes_list_image_config` \u5728 `.env` \u6587\u4ef6\u4e2d\u7684\u8bbe\u7f6e\u793a\u4f8b\u5982\u4e0b\uff1a\n\n```\nmemes_list_image_config='\n{\n \"sort_by\": \"keywords\",\n \"sort_reverse\": false,\n \"text_template\": \"{keywords}\",\n \"add_category_icon\": true,\n \"label_new_timedelta\": \"P30D\",\n \"label_hot_threshold\": 21,\n \"label_hot_days\": 7\n}\n'\n```\n\n### \u4f7f\u7528\n\n**\u4ee5\u4e0b\u547d\u4ee4\u9700\u8981\u52a0 [NoneBot \u547d\u4ee4\u524d\u7f00](https://nonebot.dev/docs/appendices/config#command-start-\u548c-command-separator) (\u9ed8\u8ba4\u4e3a`/`)\uff0c\u53ef\u81ea\u884c\u6dfb\u52a0\u7a7a\u5b57\u7b26**\n\n#### \u8868\u60c5\u5217\u8868\n\n- \u53d1\u9001 \u201c\u8868\u60c5\u5305\u5236\u4f5c\u201d \u67e5\u770b\u8868\u60c5\u5217\u8868\n\n#### \u8868\u60c5\u8be6\u60c5\n\n- \u53d1\u9001 \u201c\u8868\u60c5\u8be6\u60c5 + \u8868\u60c5\u540d/\u5173\u952e\u8bcd\u201d \u67e5\u770b\u8868\u60c5\u8be6\u7ec6\u4fe1\u606f\u548c\u8868\u60c5\u9884\u89c8\n\n#### \u8868\u60c5\u641c\u7d22\n\n- \u53d1\u9001 \u201c\u8868\u60c5\u641c\u7d22 + \u5173\u952e\u8bcd\u201d \u67e5\u627e\u76f8\u5173\u7684\u8868\u60c5\n\n#### \u8868\u60c5\u5305\u5f00\u5173\n\n\u201c\u8d85\u7ea7\u7528\u6237\u201d \u548c \u201c\u7ba1\u7406\u5458\u201d \u53ef\u4ee5\u542f\u7528\u6216\u7981\u7528\u67d0\u4e9b\u8868\u60c5\u5305\n\n- \u53d1\u9001 `\u542f\u7528\u8868\u60c5/\u7981\u7528\u8868\u60c5 \u8868\u60c5\u540d/\u5173\u952e\u8bcd`\uff0c\u5982\uff1a`\u7981\u7528\u8868\u60c5 \u6478`\n\n\u201c\u8d85\u7ea7\u7528\u6237\u201d \u53ef\u4ee5\u8bbe\u7f6e\u67d0\u4e2a\u8868\u60c5\u5305\u7684\u7ba1\u63a7\u6a21\u5f0f\uff08\u9ed1\u540d\u5355/\u767d\u540d\u5355\uff09\n\n- \u53d1\u9001 `\u5168\u5c40\u542f\u7528\u8868\u60c5 \u8868\u60c5\u540d/\u5173\u952e\u8bcd` \u53ef\u5c06\u8868\u60c5\u8bbe\u4e3a\u9ed1\u540d\u5355\u6a21\u5f0f\uff1b\n\n- \u53d1\u9001 `\u5168\u5c40\u7981\u7528\u8868\u60c5 \u8868\u60c5\u540d/\u5173\u952e\u8bcd` \u53ef\u5c06\u8868\u60c5\u8bbe\u4e3a\u767d\u540d\u5355\u6a21\u5f0f\uff1b\n\n> [!NOTE]\n>\n> \u201c\u8d85\u7ea7\u7528\u6237\u201d \u53ef\u901a\u8fc7 [NoneBot SuperUsers](https://nonebot.dev/docs/appendices/config#superusers) \u8bbe\u7f6e\n>\n> \u201c\u7ba1\u7406\u5458\u201d \u76ee\u524d\u5305\u62ec\uff1aOneBot V11 \u9002\u914d\u5668\u4e2d\u7684\u7fa4\u4e3b\u3001\u7ba1\u7406\u5458\n\n#### \u8868\u60c5\u4f7f\u7528\n\n- \u53d1\u9001 \u201c\u5173\u952e\u8bcd + \u56fe\u7247/\u6587\u5b57\u201d \u5236\u4f5c\u8868\u60c5\n\n\u53ef\u4f7f\u7528 \u201c\u81ea\u5df1\u201d\u3001\u201c@\u67d0\u4eba\u201d \u83b7\u53d6\u6307\u5b9a\u7528\u6237\u7684\u5934\u50cf\u4f5c\u4e3a\u56fe\u7247\n\n\u53ef\u4f7f\u7528 \u201c@ + \u7528\u6237id\u201d \u6307\u5b9a\u4efb\u610f\u7528\u6237\u83b7\u53d6\u5934\u50cf\uff0c\u5982 \u201c\u6478 @114514\u201d\n\n\u53ef\u5c06\u56de\u590d\u4e2d\u7684\u6d88\u606f\u4f5c\u4e3a\u6587\u5b57\u548c\u56fe\u7247\u7684\u8f93\u5165\n\n\u793a\u4f8b\uff1a\n\n<div align=\"left\">\n <img src=\"https://s2.loli.net/2023/03/10/UDTOuPnwk3emxv4.png\" width=\"250\" />\n</div>\n\n> [!NOTE]\n>\n> - \u4e3a\u907f\u514d\u8bef\u89e6\u53d1\uff0c\u5f53\u8f93\u5165\u7684 \u56fe\u7247/\u6587\u5b57 \u6570\u91cf\u4e0d\u7b26\u65f6\uff0c\u9ed8\u8ba4\u4e0d\u4f1a\u8fdb\u884c\u63d0\u793a\uff0c\u53ef\u901a\u8fc7 `memes_prompt_params_error` \u914d\u7f6e\u9879\u8fdb\u884c\u8bbe\u7f6e\n> - \u672c\u63d2\u4ef6\u901a\u8fc7 [nonebot-plugin-userinfo](https://github.com/noneplugin/nonebot-plugin-userinfo) \u63d2\u4ef6\u83b7\u53d6\u7528\u6237\u540d\u548c\u7528\u6237\u5934\u50cf\uff0c\u5177\u4f53\u5e73\u53f0\u652f\u6301\u8303\u56f4\u53ef\u524d\u5f80\u8be5\u63d2\u4ef6\u67e5\u770b\n> - \u672c\u63d2\u4ef6\u901a\u8fc7 [nonebot-plugin-alconna](https://github.com/nonebot/plugin-alconna) \u6765\u5b9e\u73b0\u591a\u9002\u914d\u5668\u6d88\u606f\u63a5\u6536\u3001\u83b7\u53d6\u56fe\u7247\u8f93\u5165\u3001\u83b7\u53d6\u56de\u590d\u5185\u5bb9\u7b49\uff0c\u76f8\u5173\u95ee\u9898\u53ef\u524d\u5f80\u8be5\u63d2\u4ef6\u67e5\u770b\n\n#### \u968f\u673a\u8868\u60c5\n\n- \u53d1\u9001 \u201c\u968f\u673a\u8868\u60c5 + \u56fe\u7247/\u6587\u5b57\u201d \u53ef\u968f\u673a\u5236\u4f5c\u8868\u60c5\n\n\u968f\u673a\u8303\u56f4\u4e3a \u56fe\u7247/\u6587\u5b57 \u6570\u91cf\u7b26\u5408\u8981\u6c42\u7684\u8868\u60c5\n\n#### \u8868\u60c5\u8c03\u7528\u7edf\u8ba1\n\n- \u53d1\u9001 \u201c[\u6211\u7684][\u5168\u5c40]<\u65f6\u95f4\u6bb5>\u8868\u60c5\u8c03\u7528\u7edf\u8ba1 [\u8868\u60c5\u540d]\u201d \u83b7\u53d6\u8868\u60c5\u8c03\u7528\u6b21\u6570\u7edf\u8ba1\u56fe\n\n\u201c\u6211\u7684\u201d\u3001\u201c\u5168\u5c40\u201d\u3001<\u65f6\u95f4\u6bb5>\u3001\u201c\u8868\u60c5\u540d\u201d \u5747\u4e3a\u53ef\u9009\u9879\n\n<\u65f6\u95f4\u6bb5> \u7684\u5173\u952e\u8bcd\u6709\uff1a\u65e5\u3001\u672c\u65e5\u3001\u5468\u3001\u672c\u5468\u3001\u6708\u3001\u672c\u6708\u3001\u5e74\u3001\u672c\u5e74\n\n\u5982\uff1a\u201c\u6211\u7684\u4eca\u65e5\u8868\u60c5\u8c03\u7528\u7edf\u8ba1 petpet\u201d\n\n### \u76f8\u5173\u63d2\u4ef6\n\n- [nonebot-plugin-send-anything-anywhere](https://github.com/felinae98/nonebot-plugin-send-anything-anywhere) \u4e00\u4e2a\u5e2e\u52a9\u5904\u7406\u4e0d\u540c adapter \u6d88\u606f\u7684\u9002\u914d\u548c\u53d1\u9001\u7684\u63d2\u4ef6\n- [nonebot-plugin-alconna](https://github.com/nonebot/plugin-alconna) \u5f3a\u5927\u7684 Nonebot2 \u547d\u4ee4\u5339\u914d\u62d3\u5c55\uff0c\u652f\u6301\u5bcc\u6587\u672c/\u591a\u5a92\u4f53\u89e3\u6790\uff0c\u8de8\u5e73\u53f0\u6d88\u606f\u6536\u53d1\n- [nonebot-plugin-session](https://github.com/noneplugin/nonebot-plugin-session) Nonebot2 \u4f1a\u8bdd\u4fe1\u606f\u63d0\u53d6\u4e0e\u4f1a\u8bdd id \u5b9a\u4e49\u63d2\u4ef6\n- [nonebot-plugin-userinfo](https://github.com/noneplugin/nonebot-plugin-userinfo) Nonebot2 \u7528\u6237\u4fe1\u606f\u83b7\u53d6\u63d2\u4ef6\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Nonebot2 plugin for making memes",
"version": "0.7.12",
"project_urls": {
"Homepage": "https://github.com/noneplugin/nonebot-plugin-memes",
"Repository": "https://github.com/noneplugin/nonebot-plugin-memes"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c6d4204fb6f5fd77631a63c01b5119f5eaba6ab50dcbbc397165e9d771a9cfa5",
"md5": "a326149e513bf9a49256193341cc6439",
"sha256": "ffa87af1b91d8abb62dfc5e6b849e814a8a8d44935919d48acd53fe4abb90223"
},
"downloads": -1,
"filename": "nonebot_plugin_memes-0.7.12-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a326149e513bf9a49256193341cc6439",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 26313,
"upload_time": "2024-12-23T12:52:14",
"upload_time_iso_8601": "2024-12-23T12:52:14.933023Z",
"url": "https://files.pythonhosted.org/packages/c6/d4/204fb6f5fd77631a63c01b5119f5eaba6ab50dcbbc397165e9d771a9cfa5/nonebot_plugin_memes-0.7.12-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b567aa3ebc0562a20c440efbb4b2592fb0d9551e8e0aad4df6682ad76c5ba647",
"md5": "be72a405cb32ad53301e761aa1d6842e",
"sha256": "c07b05f5ede7d4a438ea3647333efd01a22c1f89ade2a72b173222cea28eaf0b"
},
"downloads": -1,
"filename": "nonebot_plugin_memes-0.7.12.tar.gz",
"has_sig": false,
"md5_digest": "be72a405cb32ad53301e761aa1d6842e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 22650,
"upload_time": "2024-12-23T12:52:17",
"upload_time_iso_8601": "2024-12-23T12:52:17.103448Z",
"url": "https://files.pythonhosted.org/packages/b5/67/aa3ebc0562a20c440efbb4b2592fb0d9551e8e0aad4df6682ad76c5ba647/nonebot_plugin_memes-0.7.12.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-23 12:52:17",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "noneplugin",
"github_project": "nonebot-plugin-memes",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "nonebot_plugin_memes"
}