From afd91410a0821626c7b2402c7ed2824a0faf7dce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wuyi=E6=97=A0=E7=96=91?= <444835641@qq.com> Date: Sat, 11 Mar 2023 19:37:59 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20=E4=BC=A0=E9=80=92`user=5Fpm`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GenshinUID/__init__.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/GenshinUID/__init__.py b/GenshinUID/__init__.py index 6e92aa0c..05e286c4 100644 --- a/GenshinUID/__init__.py +++ b/GenshinUID/__init__.py @@ -1,6 +1,7 @@ from typing import List, Literal, Optional from nonebot.log import logger +from nonebot.adapters import Bot from nonebot.matcher import Matcher from nonebot.permission import SUPERUSER from nonebot.internal.adapter import Event @@ -18,7 +19,7 @@ gsclient: Optional[GsClient] = None @get_message.handle() -async def send_char_adv(ev: Event): +async def send_char_adv(bot: Bot, ev: Event): if gsclient is None: return await connect() @@ -33,6 +34,10 @@ async def send_char_adv(ev: Event): sp_user_type: Optional[ Literal['group', 'direct', 'channel', 'sub_channel'] ] = None + pm = 3 + + if await SUPERUSER(bot, ev): + pm = 2 # qqguild if '_message' in raw_data: @@ -86,6 +91,7 @@ async def send_char_adv(ev: Event): user_id=user_id, content=message, msg_id=msg_id, + user_pm=pm, ) logger.info(f'【发送】[gsuid-core]: {msg.bot_id}') await gsclient._input(msg) @@ -117,3 +123,4 @@ async def connect(): await gsclient.start() except ConnectionRefusedError: logger.error('Core服务器连接失败...请稍后使用[启动core]命令启动...') + logger.error('Core服务器连接失败...请稍后使用[启动core]命令启动...')