Skip to content

Commit

Permalink
fix(hello): 如果没有获得 targets 直接退出
Browse files Browse the repository at this point in the history
  • Loading branch information
he0119 committed Sep 20, 2023
1 parent 037bde0 commit 6a545a2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/plugins/morning/plugins/hello/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ async def hello_on_connect(bot: Bot, session: AsyncSession) -> None:
adapter_name = extract_adapter_type(bot)
if list_targets := list_targets_map.get(adapter_name):
targets = await list_targets(bot)
if not targets:
logger.info(f"没有找到适配器 {adapter_name} 支持的发送目标")
return
for target in targets:
whereclause.append(or_(Hello.target == target.dict()))
else:
Expand Down

0 comments on commit 6a545a2

Please sign in to comment.