refactor all base things

This commit is contained in:
crazywhalecc
2022-08-13 17:00:29 +08:00
committed by Jerry Ma
parent 1c801bb205
commit b2c95d96b1
54 changed files with 3009 additions and 383 deletions

22
instant-plugin-demo.php Normal file
View File

@@ -0,0 +1,22 @@
<?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;
};
*/