prerelease of beta1

This commit is contained in:
crazywhalecc
2022-12-20 20:10:40 +08:00
parent 04247048d4
commit c9bf0fb13c
16 changed files with 585 additions and 43 deletions

View File

@@ -8,6 +8,7 @@ use Attribute;
use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor;
use Doctrine\Common\Annotations\Annotation\Target;
use ZM\Annotation\AnnotationBase;
use ZM\Annotation\Interfaces\Level;
/**
* 机器人相关事件注解
@@ -17,20 +18,28 @@ use ZM\Annotation\AnnotationBase;
* @NamedArgumentConstructor()
*/
#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
class BotEvent extends AnnotationBase
class BotEvent extends AnnotationBase implements Level
{
public function __construct(public ?string $type = null, public ?string $detail_type = null, public ?string $impl = null, public ?string $platform = null, public ?string $self_id = null, public ?string $sub_type = null)
public function __construct(public ?string $type = null, public ?string $detail_type = null, public ?string $sub_type = null, public int $level = 20)
{
}
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
?string $sub_type = null,
int $level = 20,
): BotEvent {
return new static(...func_get_args());
}
public function getLevel(): int
{
return $this->level;
}
public function setLevel($level)
{
$this->level = $level;
}
}