mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-08 01:05:37 +08:00
3.4 KiB
3.4 KiB
ZM\Context\Context
getServer
public function getServer(): Server
描述
作者很懒,什么也没有说
返回
| 类型 | 描述 |
|---|---|
| Server |
getData
public function getData(): mixed
描述
作者很懒,什么也没有说
返回
| 类型 | 描述 |
|---|---|
| mixed |
reply
public function reply(array|string $msg, bool|callable|Closure $yield): array|bool
描述
only can used by cq->message event function
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| msg | array | string |
| yield | bool | callable |
返回
| 类型 | 描述 |
|---|---|
| array | bool |
finalReply
public function finalReply(array|string $msg, bool $yield): mixed
描述
作者很懒,什么也没有说
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| msg | array | string |
| yield | bool | 是否协程挂起(true),是否绑定异步事件(Closure) |
返回
| 类型 | 描述 |
|---|---|
| mixed |
waitMessage
public function waitMessage(string $prompt, int $timeout, string $timeout_prompt): string
描述
作者很懒,什么也没有说
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| prompt | string | |
| timeout | int | |
| timeout_prompt | string |
返回
| 类型 | 描述 |
|---|---|
| string | 返回用户输入的内容 |
getArgs
public function getArgs(int|string $mode, string|Stringable $prompt_msg): float|int|string
描述
根据选定的模式获取消息参数
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| mode | int | string |
| prompt_msg | string | Stringable |
返回
| 类型 | 描述 |
|---|---|
| float | int |
getNextArg
public function getNextArg(string $prompt_msg): int|mixed|string
描述
获取下一个参数
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| prompt_msg | string | 提示语回复 |
返回
| 类型 | 描述 |
|---|---|
| int | mixed |
getFullArg
public function getFullArg(string $prompt_msg): int|mixed|string
描述
获取接下来所有的消息当成一个完整的参数(包含空格)
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| prompt_msg | string | 提示语回复 |
返回
| 类型 | 描述 |
|---|---|
| int | mixed |
getNumArg
public function getNumArg(string $prompt_msg): int|mixed|string
描述
获取下一个数字类型的参数
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| prompt_msg | string | 提示语回复 |
返回
| 类型 | 描述 |
|---|---|
| int | mixed |
cloneFromParent
public function cloneFromParent(): ContextInterface
描述
作者很懒,什么也没有说
返回
| 类型 | 描述 |
|---|---|
| ContextInterface | 返回上下文 |