diff --git a/instant-plugin-demo.php b/instant-plugin-demo.php index a0a0810d..64b59060 100644 --- a/instant-plugin-demo.php +++ b/instant-plugin-demo.php @@ -2,7 +2,7 @@ declare(strict_types=1); -$plugin = new InstantPlugin(__DIR__); +$plugin = new ZMPlugin(__DIR__); /* * 发送 "测试 123",回复 "你好,123" diff --git a/mybot.php b/mybot.php index c5fd2298..5320ba6b 100644 --- a/mybot.php +++ b/mybot.php @@ -7,7 +7,7 @@ use OneBot\Driver\Event\Http\HttpRequestEvent; require 'vendor/autoload.php'; // 创建框架 App -$app = new ZM\InstantApplication(); +$app = new ZM\ZMApplication(); // 传入自定义配置文件 $app->patchConfig([ 'driver' => 'workerman', @@ -32,7 +32,7 @@ $event = \ZM\Annotation\OneBot\BotEvent::make('message')->withMethod(function () $app->addBotEvent($event); $app->addBotCommand($cmd); -$app->registerEvent(HttpRequestEvent::getName(), function (HttpRequestEvent $event) { +$app->addEvent(HttpRequestEvent::getName(), function (HttpRequestEvent $event) { $event->withResponse(\OneBot\Http\HttpFactory::getInstance()->createResponse(503)); });