一个向安安的素描本上渲染文字并发送出去的插件
Project description
一个向安安的素描本上渲染文字并发送出去的插件
📖 介绍
一个向安安的素描本上渲染文字并发送出去的插件。支持富文本渲染。
💿 安装
使用 nb-cli 安装
在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装nb plugin install nonebot-plugin-anan-say
使用包管理器安装
在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令pip
pip install nonebot-plugin-anan-say
pdm
pdm add nonebot-plugin-anan-say
poetry
poetry add nonebot-plugin-anan-say
conda
conda install nonebot-plugin-anan-say
打开 nonebot2 项目根目录下的 pyproject.toml 文件, 在 [tool.nonebot] 部分追加写入
plugins = ["nonebot_plugin_template"]
⚙️ 配置
在 nonebot2 项目的.env文件中添加下表中的必填配置
| 配置项 | 必填 | 默认值 | 说明 |
|---|---|---|---|
| anan_say_max_font_size | 否 | 200 | 最大字号 |
| anan_say_min_font_size | 否 | 40 | 最小字号 |
| anan_say_sticker | 否 | True | 作为表情发送 |
| anan_say_font_path | 否 | 无 | 自定义字体路径(默认思源黑体) |
| anan_say_library_mode | 否 | False | 库模式 |
库模式
请您在对nonebot插件开发有一定了解后再看。不同人的bot有自己不同的插件管理方式,或者指令格式规范。单纯写死on_command无法满足不同bot的客制化需求。
如果您也有这种客制化需求,请将anan_say_library_mode设置为True。然后在您的插件里引入一下代码来进行渲染。
require('nonebot_plugin_anan_say')
from nonebot_plugin_anan_say.render import render
render函数用法:
| 参数 | 类型 | 作用 |
|---|---|---|
| txt | str | 要渲染的文本 |
| max_font_size | int | 最大字号 |
| min_font_size | int | 最小字号 |
| fontpath | str | 字体路径 |
返回值为PIL.Image.Image对象
真会有人用这东西吗?用得上的大佬基本上都自己写插件,不会考虑引入第三方的吧...
🎉 使用
指令表
| 指令 | 权限 | 需要@ | 范围 | 说明 |
|---|---|---|---|---|
| 安安说 + 命令 | 无 | 否 | 群聊 | 指令说明 |
效果图
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nonebot_plugin_anan_say-0.1.4.tar.gz.
File metadata
- Download URL: nonebot_plugin_anan_say-0.1.4.tar.gz
- Upload date:
- Size: 8.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
590c4931c75144ea9e1e78cde095a950f4ce79336f8c8efa8867f65a348c2f4c
|
|
| MD5 |
27de8909509d4a5c0aa12d060ceb4180
|
|
| BLAKE2b-256 |
bfa9298fce507e224373e9d2af3896cd4d5413b53cbceb4beb08636843fe59ac
|
File details
Details for the file nonebot_plugin_anan_say-0.1.4-py3-none-any.whl.
File metadata
- Download URL: nonebot_plugin_anan_say-0.1.4-py3-none-any.whl
- Upload date:
- Size: 8.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6d52555162e9fbaa2068689088f0a208c02db17c7b0632d4f5fac076c1f7fcf
|
|
| MD5 |
9d2866f63b3040ce7d1c23e5ceb97995
|
|
| BLAKE2b-256 |
373363a40b5ba97e9375c99dcafec935680ccb6fbdb0dc07384ba746119f1732
|