fix: no need to send when message is empty

This commit is contained in:
zhayujie
2024-03-20 12:07:05 +08:00
parent 74ebbdd761
commit c22c7102d5
2 changed files with 7 additions and 4 deletions

View File

@@ -170,11 +170,13 @@ class ChatChannel(Channel):
reply = self._generate_reply(context)
logger.debug("[WX] ready to decorate reply: {}".format(reply))
# reply的包装步骤
reply = self._decorate_reply(context, reply)
# reply的发送步骤
self._send_reply(context, reply)
# reply的包装步骤
if reply and reply.content:
reply = self._decorate_reply(context, reply)
# reply的发送步骤
self._send_reply(context, reply)
def _generate_reply(self, context: Context, reply: Reply = Reply()) -> Reply:
e_context = PluginManager().emit_event(