轻量文字转图片插件
Project description
nonebot-plugin-txt2img
✨ 轻量文字转图片插件 ✨
简介
请注意:此插件仅适配 nonebot2 2.0.0b1 及以上。
本插件由使用 PIL
库将纯文字消息转为图片,启动时会检测所需资源是否存在,若不存在会自动下载到对应位置。生成的图片以 base64
格式发送,不保存到磁盘。
安装步骤
安装 NoneBot2
完整文档可以在 这里 查看。
请在创建项目时选用 onebot v11
适配器,并且按照文档完成最小实例的创建。
安装 nonebot-plugin-txt2img
使用 pip
安装:
pip install nonebot-plugin-txt2img
在 bot.py
文件添加以下代码加载插件:
nonebot.load_plugin("nonebot-plugin-txt2img")
指令说明
指令匹配方式添加了 to_me()
规则,在群聊中使用时需要在命令首部或尾部添加 @{bot_self_id}
或 {bot_nickname}
。
使用指令:txt2img
发送指令后根据提示输入标题、内容与字体大小,即可完成图片生成。
- 标题:以
1.5
倍字体大小排版在首行居中位置。 - 内容:以
1
倍字体大小左对齐排版。 - 字体大小:位于
10~120
之间的数字。
项目致谢
本项目基于以下项目或服务实现,排名不分先后。
Project details
Release history Release notifications | RSS feed
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
Close
Hashes for nonebot-plugin-txt2img-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ed896dd30a297ab8743e7f56daa98b3ca663e7ba1681d07f9a267c7d7a55913 |
|
MD5 | 9c1211be2bc50af0294a5810b9f24eb3 |
|
BLAKE2b-256 | 863b6835e462a7bf2a0c85ff9589dc84f8dd5869749e00d4a709887af20087ea |
Close
Hashes for nonebot_plugin_txt2img-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c97ebe2efcaec929455549424a61fb0e0beb39964d6369c1637ea4f6cd766d9 |
|
MD5 | 912bfaeda33a5321a78a13e3474ad116 |
|
BLAKE2b-256 | d68a18b81662251671dabe9f6a28dc41ce97edd0f45f760d1d5c1b05e5cbc448 |