Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions arclet/entari/command/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ async def supply(
elif pres.value is False:
fut.set_result(None)
return BLOCK if self.block else STOP
msg = None
if _res.matched or not may_help_text:
res = CommandResult(self.cmd, _res, may_help_text)
elif session:
Expand All @@ -169,13 +170,14 @@ async def supply(
msg = None
elif isinstance(ores.value, str | MessageChain):
msg = MessageChain(ores.value)
if msg:
await session.send(msg)
may_help_text = None
res = CommandResult(self.cmd, _res, may_help_text)
else:
res = CommandResult(self.cmd, _res, may_help_text)
fut.set_result(res)
# 先完成 future 再发送输出,发送失败时共享缓存的其他订阅者不会一直等待
if msg and session:
await session.send(msg)
if not _res.matched and not may_help_text:
return BLOCK if self.block else STOP
return {"alc_result": res}
Expand Down
Loading