Skip to main content

轻量文字转图片插件

Project description

nonebot-plugin-txt2img

✨ 轻量文字转图片插件 ✨

license pypi python

简介

请注意:此插件仅适配 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nonebot-plugin-txt2img-0.1.1.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nonebot_plugin_txt2img-0.1.1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file nonebot-plugin-txt2img-0.1.1.tar.gz.

File metadata

  • Download URL: nonebot-plugin-txt2img-0.1.1.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.9.10 Windows/10

File hashes

Hashes for nonebot-plugin-txt2img-0.1.1.tar.gz
Algorithm Hash digest
SHA256 dba65af4dbe55b96ac6a42a52ccad7690353011818b3a989f6ba21a11ef1b255
MD5 0483af5b500cd4c65d2497e4e14bfc7e
BLAKE2b-256 457e1c4924e6df4ec365727c60b2fd507d5bc65e555405ed51d25430fdfd25de

See more details on using hashes here.

File details

Details for the file nonebot_plugin_txt2img-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_txt2img-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c92b24087acba73191274da58c155de968cc0b9d8f413d322203124ed2047fb6
MD5 c6b2611d6ed897e0b718fef7576bdb1f
BLAKE2b-256 4c26cf8b698fb636699b2fd25fdd551692777cb916928fe9c935c1469f1c7ad0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page