mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-21 07:35:34 +08:00
27 lines
517 B
PHP
27 lines
517 B
PHP
|
|
<?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;
|
||
|
|
}
|
||
|
|
}
|