mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-04 03:10:01 +08:00
🎨 统一发送格式
This commit is contained in:
@@ -6,7 +6,6 @@ from zhenxun.models.group_console import GroupConsole
|
||||
from zhenxun.models.group_member_info import GroupInfoUser
|
||||
from zhenxun.models.plugin_info import PluginInfo
|
||||
from zhenxun.models.statistics import Statistics
|
||||
from zhenxun.models.user_console import UserConsole
|
||||
from zhenxun.utils.enum import PluginType
|
||||
from zhenxun.utils.image_utils import BuildImage, BuildMat, MatType
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ from nonebot_plugin_session import EventSession
|
||||
|
||||
from zhenxun.configs.utils import PluginExtraData
|
||||
from zhenxun.utils.enum import PluginType
|
||||
from zhenxun.utils.message import MessageUtils
|
||||
|
||||
from ._data_source import StatisticsManage
|
||||
|
||||
@@ -155,8 +156,8 @@ async def _(
|
||||
plugin_name, arparma.find("global"), st, uid, gid
|
||||
):
|
||||
if isinstance(result, str):
|
||||
await Text(result).finish(reply=True)
|
||||
await MessageUtils.build_message(result).finish(reply_to=True)
|
||||
else:
|
||||
await Image(result.pic2bytes()).send()
|
||||
await MessageUtils.build_message(result).send()
|
||||
else:
|
||||
await Text("获取数据失败...").send()
|
||||
|
||||
@@ -27,11 +27,10 @@ async def _(
|
||||
):
|
||||
plugin = await PluginInfo.get_or_none(module=matcher.plugin_name)
|
||||
plugin_type = plugin.plugin_type if plugin else None
|
||||
if (
|
||||
plugin_type == PluginType.NORMAL
|
||||
and matcher.priority not in [1, 999]
|
||||
and matcher.plugin_name not in ["update_info", "statistics_handle"]
|
||||
):
|
||||
if plugin_type == PluginType.NORMAL and matcher.plugin_name not in [
|
||||
"update_info",
|
||||
"statistics_handle",
|
||||
]:
|
||||
await Statistics.create(
|
||||
user_id=session.id1,
|
||||
group_id=session.id3 or session.id2,
|
||||
|
||||
Reference in New Issue
Block a user