|
Zhamao Framework
3.0.0-beta1
A high-performance chatbot + web framework
|
Public 成员函数 | |
| __construct (string $submodule='', ?AnnotationParser $parser=null) | |
| parseBotCommand (BotCommand $command, ?array $same_method_annotations=null) | |
| parseCommandArgument () | |
| handleBotCommand (BotEvent $event, BotContext $ctx) | |
| handleUnknownWSReverseInput (WebSocketOpenEvent $event) | |
| handleWSReverseOpen (WebSocketOpenEvent $event) | |
| handleWSReverseMessage (WebSocketMessageEvent $event) | |
Public 成员函数 继承自 ZMPlugin | |
| __construct (string $dir) | |
| getDir () | |
| addBotEvent (BotEvent $event) | |
| addBotCommand (BotCommand $command) | |
| addEvent (string $event_name, callable $callback, int $level=20) | |
| addHttpRoute (Route $route) | |
| getBotEvents () | |
| getBotCommands () | |
| getEvents () | |
| getRoutes () | |
额外继承的成员函数 | |
Protected 属性 继承自 ZMPlugin | |
| string | $dir |
| array | $bot_events = [] |
| array | $bot_commands = [] |
| array | $events = [] |
| array | $routes = [] |
| __construct | ( | string | $submodule = '', |
| ?AnnotationParser | $parser = null |
||
| ) |
| handleBotCommand | ( | BotEvent | $event, |
| BotContext | $ctx | ||
| ) |
调用 BotCommand 注解的方法
| BotEvent | $event | BotEvent 事件 |
| BotContext | $ctx | 机器人环境上下文 |
| handleUnknownWSReverseInput | ( | WebSocketOpenEvent | $event | ) |
| StopException |
| handleWSReverseMessage | ( | WebSocketMessageEvent | $event | ) |
处理 WebSocket 消息
| WebSocketMessageEvent | $event | 事件对象 |
| OneBotException | |
| handleWSReverseOpen | ( | WebSocketOpenEvent | $event | ) |
接入和认证反向 WS 的连接
| StopException |
| parseBotCommand | ( | BotCommand | $command, |
| ?array | $same_method_annotations = null |
||
| ) |
将 BotCommand 假设含有 CommandArgument 的话,就注册到参数列表中
| BotCommand | $command | 命令对象 |
| null | array | $same_method_annotations | 同一个方法的所有注解 |
| parseCommandArgument | ( | ) |
忽略解析记录 CommandArgument 注解