diff --git a/GenshinUID/client.py b/GenshinUID/client.py index bc0c4322..75476d1c 100644 --- a/GenshinUID/client.py +++ b/GenshinUID/client.py @@ -405,11 +405,12 @@ async def onebot_red_send( target_type: Optional[str], ): from nonebot.adapters.red.bot import Bot + from nonebot.adapters.red.api.model import ChatType from nonebot.adapters.red.message import Message, MessageSegment assert isinstance(bot, Bot) - chat_type = 2 if target_type == 'group' else 1 + chat_type = ChatType.GROUP if target_type == 'group' else ChatType.FRIEND async def _send(content: Optional[str], image: Optional[str]): result_msg: Message = Message() @@ -431,11 +432,7 @@ async def onebot_red_send( result_msg += MessageSegment.file(path) if target_id: - await bot.send_message( - chat_type, # type: ignore - target_id, - result_msg, - ) + await bot.send_message(chat_type, target_id, result_msg) if file: del_file(path) # type: ignore