Zhamao Framework 3.2.4
A high-performance chatbot + web framework
载入中...
搜索中...
未找到
BotContext类 参考
类 BotContext 继承关系图:
[图例]
BotContext 的协作图:
[图例]

Public 成员函数

 __construct (string $bot_id, string $platform)
 
 getEvent ()
 
 promptString (string|\Stringable|MessageSegment|array $prompt='', int $timeout=600, string|\Stringable|MessageSegment|array $timeout_prompt='', int $option=ZM_PROMPT_NONE)
 
 hasReplied ()
 
 flushReply ()
 
 getBot (string $bot_id, string $platform='')
 
 setParams (array $params)
 
 getParam (string|int $name)
 
 getParamString (string|int $name)
 
 getParams ()
 
 getSelf ()
 

Protected 属性

array $self
 
array $params = []
 

静态 Protected 属性

static array $bots = []
 

构造及析构函数说明

◆ __construct()

__construct ( string  $bot_id,
string  $platform 
)

成员函数说明

◆ flushReply()

flushReply ( )

重置当前上下文为没有被回复过

函数调用图:

◆ getBot()

getBot ( string  $bot_id,
string  $platform = '' 
)

获取其他机器人的上下文操作对象

参数
string$bot_id机器人的 self.user_id 对应的 ID
string$platform机器人的 self.platform 对应的 platform
异常
OneBot12Exception

◆ getEvent()

getEvent ( )

获取机器人事件对象

异常
DependencyException
NotFoundException
函数调用图:

◆ getParam()

getParam ( string|int  $name)

获取单个参数值,不存在则返回 null

参数
int | string$name参数名称或索引

◆ getParams()

getParams ( )

获取所有参数

◆ getParamString()

getParamString ( string|int  $name)
函数调用图:

◆ getSelf()

getSelf ( )

◆ hasReplied()

hasReplied ( )

返回是否已经调用过回复了

函数调用图:

◆ promptString()

promptString ( string|\Stringable|MessageSegment|array  $prompt = '',
int  $timeout = 600,
string|\Stringable|MessageSegment|array  $timeout_prompt = '',
int  $option = ZM_PROMPT_NONE 
)

在当前会话等待用户一条消息,且直接返回消息的字符串形式 如果是私聊,就在对应的机器人私聊环境下等待 如果是单级群组,就在对应的群组下等待当前消息人的消息 如果是多级群组,则等待最小级下当前消息人的消息 @noinspection PhpUnhandledExceptionInspection

◆ setParams()

setParams ( array  $params)

设置该消息下解析出来的参数列表

参数
array$params参数列表

结构体成员变量说明

◆ $bots

array $bots = []
staticprotected

◆ $params

array $params = []
protected

◆ $self

array $self
protected

该类的文档由以下文件生成: