separate ZMPlugin to traits

This commit is contained in:
crazywhalecc
2023-01-12 09:39:52 +08:00
parent a420c3ab23
commit dd6b700b47
11 changed files with 211 additions and 71 deletions

View File

@@ -0,0 +1,26 @@
<?php
namespace ZM\Plugin\Traits;
use ZM\Annotation\OneBot\BotCommand;
trait BotCommandTrait
{
/** @var array 机器人指令列表 */
protected array $bot_commands = [];
/**
* 添加一个 OneBot 机器人命令
*
* @param BotCommand $command BotCommand 注解对象
*/
public function addBotCommand(BotCommand $command): void
{
$this->bot_commands[] = $command;
}
public function getBotCommands(): array
{
return $this->bot_commands;
}
}