2022-08-01 16:31:54 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace ZM\Annotation\OneBot;
|
|
|
|
|
|
|
|
|
|
use Attribute;
|
|
|
|
|
use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor;
|
|
|
|
|
use Doctrine\Common\Annotations\Annotation\Target;
|
|
|
|
|
use ZM\Annotation\AnnotationBase;
|
|
|
|
|
|
|
|
|
|
/**
|
2022-08-13 17:00:29 +08:00
|
|
|
* 机器人相关事件注解
|
|
|
|
|
*
|
2022-08-01 16:31:54 +08:00
|
|
|
* @Annotation
|
|
|
|
|
* @Target("METHOD")
|
2022-08-13 17:00:29 +08:00
|
|
|
* @NamedArgumentConstructor()
|
2022-08-01 16:31:54 +08:00
|
|
|
*/
|
|
|
|
|
#[Attribute(Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
|
2022-08-13 17:00:29 +08:00
|
|
|
class BotEvent extends AnnotationBase
|
2022-08-01 16:31:54 +08:00
|
|
|
{
|
|
|
|
|
/** @var null|string */
|
|
|
|
|
public $type;
|
|
|
|
|
|
|
|
|
|
/** @var null|string */
|
|
|
|
|
public $detail_type;
|
|
|
|
|
|
|
|
|
|
/** @var null|string */
|
|
|
|
|
public $impl;
|
|
|
|
|
|
|
|
|
|
/** @var null|string */
|
|
|
|
|
public $platform;
|
|
|
|
|
|
|
|
|
|
/** @var null|string */
|
|
|
|
|
public $self_id;
|
|
|
|
|
|
|
|
|
|
/** @var null|string */
|
|
|
|
|
public $sub_type;
|
|
|
|
|
|
|
|
|
|
public function __construct(
|
|
|
|
|
?string $type = null,
|
|
|
|
|
?string $detail_type = null,
|
|
|
|
|
?string $impl = null,
|
|
|
|
|
?string $platform = null,
|
|
|
|
|
?string $self_id = null,
|
|
|
|
|
?string $sub_type = null
|
|
|
|
|
) {
|
|
|
|
|
$this->type = $type;
|
|
|
|
|
$this->detail_type = $detail_type;
|
|
|
|
|
$this->impl = $impl;
|
|
|
|
|
$this->platform = $platform;
|
|
|
|
|
$this->self_id = $self_id;
|
|
|
|
|
$this->sub_type = $sub_type;
|
|
|
|
|
}
|
2022-08-13 17:00:29 +08:00
|
|
|
|
|
|
|
|
public static function make(
|
|
|
|
|
?string $type = null,
|
|
|
|
|
?string $detail_type = null,
|
|
|
|
|
?string $impl = null,
|
|
|
|
|
?string $platform = null,
|
|
|
|
|
?string $self_id = null,
|
|
|
|
|
?string $sub_type = null
|
|
|
|
|
): BotEvent {
|
|
|
|
|
return new static(...func_get_args());
|
|
|
|
|
}
|
2022-08-01 16:31:54 +08:00
|
|
|
}
|