Skip to main content

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

Project description

Nonebot_plugin_templates

pypi python pypi
onebot github

最新版本号0.1.3

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

构建一个菜单的示例

from nonebot import require
require("nonebot_plugin_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.6.tar.gz (7.1 MB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for nonebot_plugin_templates-0.1.6.tar.gz
Algorithm Hash digest
SHA256 c6b5cd516fddb821e741c1a2c69475c5abc54791106518b606522659f9aeb6f5
MD5 74b9121ddb90c8ba2d2182d6b8568594
BLAKE2b-256 92caa9c93ba96f4af49cbb03b883d54274a0909d7edc302898c0c13f1cb9b82a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nonebot_plugin_templates-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 f0f483afc71d62403df94a7b22861946902e706ef116d28ba62e92c61b512d0c
MD5 8a7965cfcb30e887e96fd8d3a51c5566
BLAKE2b-256 41bf4f52e51e42ae04680f6aeecb755cd0b0c9bd470779a4eb500666ffaf18cd

See more details on using hashes here.

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