Skip to main content

一个向安安的素描本上渲染文字并发送出去的插件

Project description

NoneBotPluginLogo

NoneBotPluginText

nonebot-plugin-anan-say

✨ 安安的素描本上都写了什么呢? ✨

license pypi python

本插件仅供学习交流使用,请勿用于其他用途 版权争议请提出 issue 协商

一个向安安的素描本上渲染文字并发送出去的插件

📖 介绍

一个向安安的素描本上渲染文字并发送出去的插件。支持富文本渲染。

💿 安装

使用 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_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

nonebot_plugin_anan_say-0.1.1.tar.gz (8.3 MB view details)

Uploaded Source

Built Distribution

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

nonebot_plugin_anan_say-0.1.1-py3-none-any.whl (8.3 MB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_anan_say-0.1.1.tar.gz.

File metadata

  • Download URL: nonebot_plugin_anan_say-0.1.1.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

Hashes for nonebot_plugin_anan_say-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c1938dc0752e1106abb6f160a3f9df6144ffd576a970462e6fa3bd6a089c4e73
MD5 56137672f34aa85f2beb35eb04588cc1
BLAKE2b-256 614e96d1fb3103beb960375ca8f71f00c093451b66794df65155f7fc992c2a2d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nonebot_plugin_anan_say-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0d7068353b6f067d1eb3dfa6e48000fd7f87d2b00d6dbe549b8d1864eb058800
MD5 cf0f83074a894928fce061299766dcc0
BLAKE2b-256 0d3776355a70293efc62dbd2534297ba49aca1f60afcb55d221b890a15804b1f

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