mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-03-18 05:04:51 +08:00
23 lines
654 B
PHP
23 lines
654 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
declare(strict_types=1);
|
||
|
|
|
||
|
|
/*
|
||
|
|
return function () {
|
||
|
|
$plugin = new \ZM\Plugin\InstantPlugin(__DIR__);
|
||
|
|
|
||
|
|
$cmd = \ZM\Annotation\OneBot\BotCommand::make(name: 'test', match: '测试')->withArgument(name: 'arg1')->withMethod(function () {
|
||
|
|
ctx()->reply('test ok');
|
||
|
|
});
|
||
|
|
$event = BotEvent::make(type: 'message')->withMethod(function () {
|
||
|
|
});
|
||
|
|
$plugin->addBotEvent($event);
|
||
|
|
$plugin->addBotCommand($cmd);
|
||
|
|
|
||
|
|
$plugin->registerEvent(HttpRequestEvent::getName(), function (HttpRequestEvent $event) {
|
||
|
|
$event->withResponse(\OneBot\Http\HttpFactory::getInstance()->createResponse(503));
|
||
|
|
});
|
||
|
|
return $plugin;
|
||
|
|
};
|
||
|
|
*/
|