add state and ctrl+C support for windows

This commit is contained in:
crazywhalecc
2022-09-26 22:44:41 +08:00
parent cf3f09600b
commit a4f992b9e5
14 changed files with 143 additions and 108 deletions

View File

@@ -59,8 +59,7 @@ class BotCommand extends AnnotationBase implements Level
/** @var int */
public $level = 20;
/** @var array */
private $arguments = [];
private array $arguments = [];
public function __construct(
$name = '',

View File

@@ -19,23 +19,17 @@ use ZM\Annotation\AnnotationBase;
#[Attribute(Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
class BotEvent extends AnnotationBase
{
/** @var null|string */
public $type;
public ?string $type;
/** @var null|string */
public $detail_type;
public ?string $detail_type;
/** @var null|string */
public $impl;
public ?string $impl;
/** @var null|string */
public $platform;
public ?string $platform;
/** @var null|string */
public $self_id;
public ?string $self_id;
/** @var null|string */
public $sub_type;
public ?string $sub_type;
public function __construct(
?string $type = null,

View File

@@ -22,45 +22,23 @@ use ZM\Exception\ZMKnownException;
class CommandArgument extends AnnotationBase implements ErgodicAnnotation
{
/**
* @var string
* @Required()
*/
public $name;
public string $name;
/**
* @var string
*/
public $description = '';
public string $description = '';
/**
* @var string
*/
public $type = 'string';
public string $type = 'string';
/**
* @var bool
*/
public $required = false;
public bool $required = false;
/**
* @var string
*/
public $prompt = '';
public string $prompt = '';
/**
* @var string
*/
public $default = '';
public string $default = '';
/**
* @var int
*/
public $timeout = 60;
public int $timeout = 60;
/**
* @var int
*/
public $error_prompt_policy = 1;
public int $error_prompt_policy = 1;
/**
* @param string $name 参数名称(可以是中文)