From 59d47210bcc0db33950df94ae712ea1bb0415b80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wuyi=E6=97=A0=E7=96=91?= <444835641@qq.com> Date: Tue, 18 Apr 2023 02:00:36 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E5=B0=9D=E8=AF=95=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E6=9C=AA=E6=AD=A3=E7=A1=AE=E8=8E=B7=E5=8F=96Bot?= =?UTF-8?q?=E5=AE=9E=E4=BE=8B=20(#505)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GenshinUID/client.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/GenshinUID/client.py b/GenshinUID/client.py index 7b292fbd..c60ff2f1 100644 --- a/GenshinUID/client.py +++ b/GenshinUID/client.py @@ -36,13 +36,18 @@ else: def _get_bot(bot_id: str) -> Bot: - if 'onebot' in bot_id: - bot_id = 'onebot' + if 'v12' in bot_id: + bot_id = 'onebotv12' + # bots: Dict[str, str] 以适配器名称为键、bot_self_id为值的字典 if bot_id not in bots: for _bot_id in bots.keys(): if bot_id in _bot_id: bot_id = _bot_id break + else: + logger.warning('未获取到正确的Bot实例,将使用默认Bot...') + logger.warning(f'当前bot_id: {bot_id}, bots: {bots}') + return get_bot() bot_real_id = bots[bot_id] bot = get_bot(bot_real_id) return bot