diff --git a/composer.json b/composer.json index c66afb9a..a0451b95 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description": "High performance QQ robot and web server development framework", "minimum-stability": "stable", "license": "Apache-2.0", - "version": "2.0.2", + "version": "2.0.3", "extra": [], "authors": [ { diff --git a/docs/update/v2.md b/docs/update/v2.md index 42dede7f..aa5a7b3c 100644 --- a/docs/update/v2.md +++ b/docs/update/v2.md @@ -1,8 +1,21 @@ # 更新日志(v2 版本) +## v2.0.3 + +> 更新事件:2020.12.31 + +- 修复:CQBefore 注解事件在 level 低于 200 时无法调用的 bug +- 修复:CQMetaEvent 注解事件调用时报错的 bug + +## v2.0.2 + +> 更新时间:2020.12.31 + +- 更新:将 CQ 码调用类更新到与最新 OneBot 标准相兼容的状态 + ## v2.0.1 -> 更新事件:2020.12.23 +> 更新时间:2020.12.23 - 修复:开屏报错文件夹不存在 diff --git a/src/ZM/Module/QQBot.php b/src/ZM/Module/QQBot.php index c37207a4..02eebf3a 100644 --- a/src/ZM/Module/QQBot.php +++ b/src/ZM/Module/QQBot.php @@ -52,9 +52,7 @@ class QQBot public function dispatchBeforeEvents($data) { $before = new EventDispatcher(CQBefore::class); $before->setRuleFunction(function ($v) use ($data) { - if ($v->level < 200) EventDispatcher::interrupt(); - elseif ($v->cq_event != $data["post_type"]) return false; - return true; + return $v->cq_event == $data["post_type"]; }); $before->setReturnFunction(function ($result) { if (!$result) EventDispatcher::interrupt(); @@ -137,8 +135,7 @@ class QQBot //Console::success("当前数据包:".json_encode(ctx()->getData())); $dispatcher = new EventDispatcher(CQMetaEvent::class); $dispatcher->setRuleFunction(function (CQMetaEvent $v) { - return ($v->meta_event_type == '' || ($v->meta_event_type != '' && $v->meta_event_type == ctx()->getData()["meta_event_type"])) && - ($v->sub_type == '' || ($v->sub_type != '' && $v->sub_type == (ctx()->getData()["sub_type"] ?? ''))); + return ($v->meta_event_type == '' || ($v->meta_event_type != '' && $v->meta_event_type == ctx()->getData()["meta_event_type"])); }); //eval(BP); $dispatcher->dispatchEvents(ctx()->getData());