mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-03-17 20:54:52 +08:00
rename Instant to ZM
This commit is contained in:
parent
1173949bba
commit
8c6aba9361
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
$plugin = new InstantPlugin(__DIR__);
|
$plugin = new ZMPlugin(__DIR__);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 发送 "测试 123",回复 "你好,123"
|
* 发送 "测试 123",回复 "你好,123"
|
||||||
|
|||||||
@ -7,7 +7,7 @@ use OneBot\Driver\Event\Http\HttpRequestEvent;
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
// 创建框架 App
|
// 创建框架 App
|
||||||
$app = new ZM\InstantApplication();
|
$app = new ZM\ZMApplication();
|
||||||
// 传入自定义配置文件
|
// 传入自定义配置文件
|
||||||
$app->patchConfig([
|
$app->patchConfig([
|
||||||
'driver' => 'workerman',
|
'driver' => 'workerman',
|
||||||
@ -32,7 +32,7 @@ $event = \ZM\Annotation\OneBot\BotEvent::make('message')->withMethod(function ()
|
|||||||
$app->addBotEvent($event);
|
$app->addBotEvent($event);
|
||||||
$app->addBotCommand($cmd);
|
$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));
|
$event->withResponse(\OneBot\Http\HttpFactory::getInstance()->createResponse(503));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user