Skip to main content

为nonebot提供一系列jinja2 template模板,方便的生成图片

Project description

Nonebot_plugin_templates

pypi python pypi
onebot github

最新版本号0.1.3

功能:提供一些jinja2 templates渲染,并提供构建所需参数的类

构建一个菜单的示例

from nonebot_plugin_templates.template_types import *
from nonebot_plugin_templates.templates_render import menu_render, colorlist_render

menu = Menu("私有bot", des="使用和管理自己独有的bot的命令,私有bot只有主人可使用,其他人无法使用",
            funcs=Funcs(
                Func("/bot名称+询问的问题",
                     "与指定属于自己的bot对话\n(可使用'回复'某bot最后一个答案来连续和它对话)\n(可回复'清除历史','刷新对话'来清除bot的对话记忆)") +
                Func("/所有bot",
                     "查询所有的可用的私有的bot,以获取bot名称和相关信息") +
                Func("/创建bot", "创建新的私有的bot") +
                Func("/改名bot", "更改自己的bot的名称") +
                Func("/删除bot", "删除指定自己的bot")))
menu += Menu("公有bot", des="使用和管理公有的bot的命令",
             funcs=Funcs(
                 Func("bot名称+询问的问题",
                      "与指定属于公共的bot对话\n(可使用'回复'某bot最后一个答案来连续和它对话)\n(可回复'清除历史','刷新对话'来清除bot的对话记忆)") +
                 Func("所有bot", "查询所有的可用的公共的bot,以获取bot名称和相关信息") +
                 Func("创建bot", "创建新的公用的bot") +
                 Func("改名bot", "更改公用的bot的名称") +
                 Func("删除bot", "删除指定公用的bot")))
pic_bytes = await menu_render(menu, 800)

menu.png

构建一个卡片列表的示例

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_templates-0.1.5.tar.gz (7.1 MB view details)

Uploaded Source

Built Distribution

nonebot_plugin_templates-0.1.5-py3-none-any.whl (7.1 MB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_templates-0.1.5.tar.gz.

File metadata

File hashes

Hashes for nonebot_plugin_templates-0.1.5.tar.gz
Algorithm Hash digest
SHA256 a10f98a1c1323cc65847ef0f3f17adbb181a5b147bcd17b93fcc500e8c715df4
MD5 e5b0b8d2f130ec302803ceeb5c1f5f70
BLAKE2b-256 f6f2ed6ea1a45e9deba5f90696200c1129058186c7dd375d351b7ad882a0c447

See more details on using hashes here.

Provenance

File details

Details for the file nonebot_plugin_templates-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_templates-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 ff99d06e740b5193a356d8b592a2282f11daa81405201e646ec9ccde02843501
MD5 bce12a7a630dd767b16d138e3f89ab7c
BLAKE2b-256 e5c6ad812cc38c737f8d307861638e1fefd01aa3c213e190e3cc7ef7ed2b4517

See more details on using hashes here.

Provenance

Supported by

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