diff --git a/pkg/plugin/host.py b/pkg/plugin/host.py index db4da87..27a6c1e 100644 --- a/pkg/plugin/host.py +++ b/pkg/plugin/host.py @@ -70,6 +70,8 @@ def generate_plugin_order(): def iter_plugins(): """按照顺序迭代插件""" for plugin_name in __plugins_order__: + if plugin_name not in __plugins__: + continue yield __plugins__[plugin_name] diff --git a/pkg/qqbot/sources/nakuru.py b/pkg/qqbot/sources/nakuru.py index 4210296..3f70b4b 100644 --- a/pkg/qqbot/sources/nakuru.py +++ b/pkg/qqbot/sources/nakuru.py @@ -185,7 +185,11 @@ class NakuruProjectAdapter(MessageSourceAdapter): if resp.status_code == 403: logging.error("go-cqhttp拒绝访问,请检查config.py中nakuru_config的token是否与go-cqhttp设置的access-token匹配") raise Exception("go-cqhttp拒绝访问,请检查config.py中nakuru_config的token是否与go-cqhttp设置的access-token匹配") - self.bot_account_id = int(resp.json()['data']['user_id']) + try: + self.bot_account_id = int(resp.json()['data']['user_id']) + except Exception as e: + logging.error("获取go-cqhttp账号信息失败: {}, 请检查是否已启动go-cqhttp并配置正确".format(e)) + raise Exception("获取go-cqhttp账号信息失败: {}, 请检查是否已启动go-cqhttp并配置正确".format(e)) def send_message( self,