mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-09-29 00:32:06 +08:00
🐛 修复添加插件依赖更新 (#1837)
* 🐛 修复添加插件依赖更新 * 🔧 修改插件依赖安装命令为使用poetry运行pip * 🐛 修复群组入群与退群提示 * 🐛 修复群组踢出用户提醒 * 🎨 代码优化 * 🎨 群欢迎迁移优化 * 🩹 精确webui调用统计 * 🚨 auto fix by pre-commit hooks * 🐛 修复测试 * 🎨 fix pre-commit.ci * 🎨 fix pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
pre-commit-ci[bot]
parent
d6fd5f170a
commit
4ed1791b30
@@ -17,6 +17,7 @@ from nonebot_plugin_alconna import (
|
||||
Voice,
|
||||
)
|
||||
from pydantic import BaseModel
|
||||
import ujson as json
|
||||
|
||||
from zhenxun.configs.config import BotConfig
|
||||
from zhenxun.services.log import logger
|
||||
@@ -141,6 +142,21 @@ class MessageUtils:
|
||||
)
|
||||
return UniMessage(Reference(nodes=node_list))
|
||||
|
||||
@classmethod
|
||||
def markdown(cls, content: dict) -> Message:
|
||||
"""markdown格式消息
|
||||
|
||||
参数:
|
||||
content: 消息内容
|
||||
|
||||
返回:
|
||||
Message: 构造完成的消息
|
||||
"""
|
||||
content_data = base64.b64encode(json.dumps(content).encode("utf-8")).decode(
|
||||
"utf-8"
|
||||
)
|
||||
return Message(f"[CQ:markdown,data=base64://{content_data}]")
|
||||
|
||||
@classmethod
|
||||
def custom_forward_msg(
|
||||
cls,
|
||||
|
||||
Reference in New Issue
Block a user