Zhamao Framework  3.0.0-beta1
A high-performance chatbot + web framework
BotCommand类 参考
类 BotCommand 继承关系图:
[图例]
BotCommand 的协作图:
[图例]

Public 成员函数

 __construct (public $name='', public $match='', public $pattern='', public $regex='', public $start_with='', public $end_with='', public $keyword='', public $alias=[], public $detail_type='', public $user_id='', public $group_id='', public $level=20)
 
 withArgument (string $name, string $description='', string $type='string', bool $required=false, string $prompt='', string $default='', int $timeout=60, int $error_prompt_policy=1)
 
 withArgumentObject (CommandArgument $argument)
 
 getLevel ()
 
 setLevel ($level)
 
 getArguments ()
 
- Public 成员函数 继承自 AnnotationBase
 __toString ()
 
 on (\Closure|callable|string $method)
 
 getIterator ()
 
 isInGroup (string $name)
 
 addGroup (string $name)
 
 getGroups ()
 

静态 Public 成员函数

static make ( $name='', $match='', $pattern='', $regex='', $start_with='', $end_with='', $keyword='', $alias=[], $message_type='', $user_id='', $group_id='', $level=20)
 

额外继承的成员函数

- 成员变量 继承自 AnnotationBase
Closure string array $method = ''
 
 $class = ''
 
array $group = []
 

详细描述

Class BotCommand 机器人指令注解

@Annotation @NamedArgumentConstructor() @Target("METHOD")

构造及析构函数说明

◆ __construct()

__construct ( public  $name = '',
public  $match = '',
public  $pattern = '',
public  $regex = '',
public  $start_with = '',
public  $end_with = '',
public  $keyword = '',
public  $alias = [],
public  $detail_type = '',
public  $user_id = '',
public  $group_id = '',
public  $level = 20 
)
参数
string[]$alias

成员函数说明

◆ getArguments()

getArguments ( )

◆ getLevel()

getLevel ( )

实现了 Level.

◆ make()

static make (   $name = '',
  $match = '',
  $pattern = '',
  $regex = '',
  $start_with = '',
  $end_with = '',
  $keyword = '',
  $alias = [],
  $message_type = '',
  $user_id = '',
  $group_id = '',
  $level = 20 
)
static

◆ setLevel()

setLevel (   $level)
参数
int$level

实现了 Level.

◆ withArgument()

withArgument ( string  $name,
string  $description = '',
string  $type = 'string',
bool  $required = false,
string  $prompt = '',
string  $default = '',
int  $timeout = 60,
int  $error_prompt_policy = 1 
)
异常
InvalidArgumentException
ZMKnownException

◆ withArgumentObject()

withArgumentObject ( CommandArgument  $argument)

该类的文档由以下文件生成: