feat: 支持多个事件的返回值

This commit is contained in:
Rock Chin
2023-01-15 20:37:23 +08:00
parent df9e89deb7
commit e582780195
3 changed files with 22 additions and 0 deletions

View File

@@ -81,6 +81,9 @@ def process_message(launcher_type: str, launcher_id: int, text_message: str, mes
if launcher_type == 'person'
else plugin_models.GroupCommandSent, **args)
if event.get_return_value("alter") is not None:
text_message = event.get_return_value("alter")
# 取出插件提交的返回值赋值给reply
if event.get_return_value("reply") is not None:
reply.append(event.get_return("reply"))
@@ -101,6 +104,9 @@ def process_message(launcher_type: str, launcher_id: int, text_message: str, mes
if launcher_type == 'person'
else plugin_models.GroupNormalMessageReceived, **args)
if event.get_return_value("alter") is not None:
text_message = event.get_return_value("alter")
if not event.is_prevented_default():
reply = pkg.qqbot.message.process_normal_message(text_message,
mgr, config, launcher_type, launcher_id, sender_id)