Skip to main content

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

Project description

Nonebot_plugin_templates

pypi python pypi
onebot github

最新版本号0.1.1

功能:提供一些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)

构建一个卡片列表的示例

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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for nonebot_plugin_templates-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d61653d7cc2b1b4573ad9add14fb18dd1c70f425ecf1502eb9dc255e62f8db0b
MD5 00e1fc7e2741bd8a3f57d4028a0215a8
BLAKE2b-256 1b2dac58b9134f9fd854e6ae6ed67259e91e4ff6d1d26bd44216533829e23aba

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for nonebot_plugin_templates-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a79f35d4ae9deec3309fefe38201f9ac8ba1062a6d1befe8eca408808dad8b95
MD5 dc8f2e55ee737fd99f8afe6bebb8f075
BLAKE2b-256 95aef639e16d9fd359426c791f13e5b3d9a05a265b71dd654a7d874194c965bd

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