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

nonebot_plugin_anan_say-0.1.2.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.2-py3-none-any.whl (8.3 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nonebot_plugin_anan_say-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 5334891bca38fa4aea04dbd3881c0ef8036d5ead528902f13b7aef5b88977b1f
MD5 794ec5ec2b842b557043113740bb0bcc
BLAKE2b-256 f3042354cfd3ed9828ff83d7bedbc86b036fbac4a6cc707fc0dd48c06dff82c6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nonebot_plugin_anan_say-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4a32d9f65b77a61bc1d371ebe754c40876c6dba1dd2b027f0c78c570c914d780
MD5 7ac2fa6e66631f11bb19e1cfd76a5e6d
BLAKE2b-256 e4090f1677c46508dc331d8db1ceecd7999b00264f1da598706ec3ef70415211

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