mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-21 23:55:35 +08:00
refactor and add some customizable context functions
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user