refactor and add some customizable context functions

This commit is contained in:
crazywhalecc
2023-03-11 19:53:24 +08:00
committed by Jerry
parent c147c8fe22
commit eb2e0a5e92
3 changed files with 34 additions and 8 deletions

View File

@@ -13,7 +13,7 @@ class BotConnectContext
{
use BotActionTrait;
private ?array $self = null;
protected ?array $self = null;
public function __construct(private int $flag, private int $fd)
{

View File

@@ -22,13 +22,13 @@ class BotContext implements ContextInterface
use BotActionTrait;
/** @var array<string, array<string, BotContext>> 记录机器人的上下文列表 */
private static array $bots = [];
protected static array $bots = [];
/** @var null|string[] 记录当前上下文绑定的机器人 */
private ?array $self;
protected ?array $self;
/** @var array 如果是 BotCommand 匹配的上下文,这里会存放匹配到的参数 */
private array $params = [];
protected array $params = [];
public function __construct(string $bot_id, string $platform)
{