mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-03-17 20:54:52 +08:00
update to 2.0.3 version
This commit is contained in:
parent
ac45ab0dec
commit
7434bac94e
@ -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": [
|
||||
{
|
||||
|
||||
@ -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
|
||||
|
||||
- 修复:开屏报错文件夹不存在
|
||||
|
||||
|
||||
@ -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());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user