mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-20 15:15:35 +08:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7434bac94e |
@@ -3,7 +3,7 @@
|
|||||||
"description": "High performance QQ robot and web server development framework",
|
"description": "High performance QQ robot and web server development framework",
|
||||||
"minimum-stability": "stable",
|
"minimum-stability": "stable",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"version": "2.0.2",
|
"version": "2.0.3",
|
||||||
"extra": [],
|
"extra": [],
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,21 @@
|
|||||||
# 更新日志(v2 版本)
|
# 更新日志(v2 版本)
|
||||||
|
|
||||||
|
## v2.0.3
|
||||||
|
|
||||||
|
> 更新事件:2020.12.31
|
||||||
|
|
||||||
|
- 修复:CQBefore 注解事件在 level 低于 200 时无法调用的 bug
|
||||||
|
- 修复:CQMetaEvent 注解事件调用时报错的 bug
|
||||||
|
|
||||||
|
## v2.0.2
|
||||||
|
|
||||||
|
> 更新时间:2020.12.31
|
||||||
|
|
||||||
|
- 更新:将 CQ 码调用类更新到与最新 OneBot 标准相兼容的状态
|
||||||
|
|
||||||
## v2.0.1
|
## v2.0.1
|
||||||
|
|
||||||
> 更新事件:2020.12.23
|
> 更新时间:2020.12.23
|
||||||
|
|
||||||
- 修复:开屏报错文件夹不存在
|
- 修复:开屏报错文件夹不存在
|
||||||
|
|
||||||
|
|||||||
@@ -52,9 +52,7 @@ class QQBot
|
|||||||
public function dispatchBeforeEvents($data) {
|
public function dispatchBeforeEvents($data) {
|
||||||
$before = new EventDispatcher(CQBefore::class);
|
$before = new EventDispatcher(CQBefore::class);
|
||||||
$before->setRuleFunction(function ($v) use ($data) {
|
$before->setRuleFunction(function ($v) use ($data) {
|
||||||
if ($v->level < 200) EventDispatcher::interrupt();
|
return $v->cq_event == $data["post_type"];
|
||||||
elseif ($v->cq_event != $data["post_type"]) return false;
|
|
||||||
return true;
|
|
||||||
});
|
});
|
||||||
$before->setReturnFunction(function ($result) {
|
$before->setReturnFunction(function ($result) {
|
||||||
if (!$result) EventDispatcher::interrupt();
|
if (!$result) EventDispatcher::interrupt();
|
||||||
@@ -137,8 +135,7 @@ class QQBot
|
|||||||
//Console::success("当前数据包:".json_encode(ctx()->getData()));
|
//Console::success("当前数据包:".json_encode(ctx()->getData()));
|
||||||
$dispatcher = new EventDispatcher(CQMetaEvent::class);
|
$dispatcher = new EventDispatcher(CQMetaEvent::class);
|
||||||
$dispatcher->setRuleFunction(function (CQMetaEvent $v) {
|
$dispatcher->setRuleFunction(function (CQMetaEvent $v) {
|
||||||
return ($v->meta_event_type == '' || ($v->meta_event_type != '' && $v->meta_event_type == ctx()->getData()["meta_event_type"])) &&
|
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"] ?? '')));
|
|
||||||
});
|
});
|
||||||
//eval(BP);
|
//eval(BP);
|
||||||
$dispatcher->dispatchEvents(ctx()->getData());
|
$dispatcher->dispatchEvents(ctx()->getData());
|
||||||
|
|||||||
Reference in New Issue
Block a user