mirror of
https://github.com/AstrBotDevs/AstrBot.git
synced 2026-10-16 15:06:04 +08:00
fix: skip the respond stage on an empty message chain (#9653)
* fix: skip the respond stage on an empty message chain * Delete tests/test_respond_stage.py --------- Co-authored-by: Soulter <37870767+Soulter@users.noreply.github.com>
This commit is contained in:
@@ -179,6 +179,12 @@ class RespondStage(Stage):
|
||||
if result.result_content_type == ResultContentType.STREAMING_FINISH:
|
||||
event.set_extra("_streaming_finished", True)
|
||||
return
|
||||
if (
|
||||
not result.chain
|
||||
and result.result_content_type != ResultContentType.STREAMING_RESULT
|
||||
):
|
||||
# 空消息链没有任何可发内容,直接返回,不打日志、也不触发 after_message_sent
|
||||
return
|
||||
sent_plain_texts = event.get_extra(
|
||||
"_send_message_to_user_current_session_plain_texts",
|
||||
[],
|
||||
|
||||
Reference in New Issue
Block a user