2024-03-30 06:04:17 +08:00
|
|
|
from nonebot.adapters.onebot.v11 import MessageSegment
|
|
|
|
from nonebot.permission import SUPERUSER
|
|
|
|
from liteyuki.utils.htmlrender import render_html
|
2024-03-20 18:27:49 +08:00
|
|
|
|
2024-03-30 06:04:17 +08:00
|
|
|
from liteyuki.utils.resource import get
|
|
|
|
from nonebot import on_command
|
2024-03-20 18:27:49 +08:00
|
|
|
|
2024-03-30 06:04:17 +08:00
|
|
|
stats = on_command("stats", priority=5, permission=SUPERUSER)
|
2024-03-20 18:27:49 +08:00
|
|
|
|
|
|
|
|
2024-03-30 06:04:17 +08:00
|
|
|
@stats.handle()
|
|
|
|
async def _():
|
|
|
|
html = get("templates/stats.html")
|
|
|
|
html_bytes = await render_html(open(html, "r", encoding="utf-8").read())
|
|
|
|
await stats.finish(MessageSegment.image(html_bytes))
|