Skip to content

Commit

Permalink
fix: 插件加载bug
Browse files Browse the repository at this point in the history
  • Loading branch information
RockChinQ committed Nov 12, 2023
1 parent a8b1e6c commit 71b8bf1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pkg/plugin/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]


Expand Down
6 changes: 5 additions & 1 deletion pkg/qqbot/sources/nakuru.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,11 @@ def __init__(self, cfg: dict):
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,
Expand Down

0 comments on commit 71b8bf1

Please sign in to comment.