zhamao-framework/docs/api/ZM/API/OneBotV11.md

985 lines
17 KiB
Markdown
Raw Normal View History

2022-03-27 16:42:36 +08:00
# ZM\API\OneBotV11
## get
```php
2022-04-02 17:31:48 +00:00
public function get(int|string $robot_id): ZMRobot
2022-03-27 16:42:36 +08:00
```
### 描述
2022-04-02 17:31:48 +00:00
获取机器人Action/API实例
2022-03-27 16:42:36 +08:00
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
2022-04-02 17:31:48 +00:00
| robot_id | int|string | 机器人ID |
2022-04-01 18:48:48 +08:00
2022-03-27 16:42:36 +08:00
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| ZMRobot | 机器人实例 |
2022-03-27 16:42:36 +08:00
## getRandom
```php
public function getRandom(): ZMRobot
```
### 描述
2022-04-02 17:31:48 +00:00
随机获取一个连接到框架的机器人实例
2022-03-27 16:42:36 +08:00
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| ZMRobot | 机器人实例 |
2022-03-27 16:42:36 +08:00
## getAllRobot
```php
public function getAllRobot(): ZMRobot[]
```
### 描述
2022-04-02 17:31:48 +00:00
获取所有机器人实例
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| ZMRobot[] | 机器人实例们 |
## setCallback
```php
public function setCallback(bool|Closure $callback): OneBotV11
```
### 描述
设置回调或启用协程等待API回包
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| callback | bool|Closure | 是否开启协程或设置异步回调函数如果为true则协程等待结果如果为false则异步执行并不等待结果如果为回调函数则异步执行且调用回调 |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| OneBotV11 | 返回本身 |
## setPrefix
```php
public function setPrefix(int $prefix): OneBotV11
```
### 描述
设置API调用类型后缀
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| prefix | int | 设置后缀类型API_NORMAL为不加后缀API_ASYNC为异步调用API_RATE_LIMITED为加后缀并且限制调用频率 |
2022-04-01 18:48:48 +08:00
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| OneBotV11 | 返回本身 |
2022-03-27 16:42:36 +08:00
## sendPrivateMsg
```php
2022-04-02 17:31:48 +00:00
public function sendPrivateMsg(int|string $user_id, string $message, bool $auto_escape): array|bool
2022-03-27 16:42:36 +08:00
```
### 描述
发送私聊消息
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
2022-04-02 17:31:48 +00:00
| user_id | int|string | 用户ID |
| message | string | 消息内容 |
| auto_escape | bool | 是否自动转义默认为false |
2022-04-01 18:48:48 +08:00
2022-03-27 16:42:36 +08:00
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| array|bool | 返回API调用结果数组或异步API调用状态bool |
2022-03-27 16:42:36 +08:00
## sendGroupMsg
```php
2022-04-02 17:31:48 +00:00
public function sendGroupMsg(int|string $group_id, string $message, bool $auto_escape): array|bool
2022-03-27 16:42:36 +08:00
```
### 描述
发送群消息
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
2022-04-02 17:31:48 +00:00
| group_id | int|string | 群组ID |
| message | string | 消息内容 |
| auto_escape | bool | 是否自动转义默认为false |
2022-04-01 18:48:48 +08:00
2022-03-27 16:42:36 +08:00
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| array|bool | 返回API调用结果数组或异步API调用状态bool |
2022-03-27 16:42:36 +08:00
## sendMsg
```php
2022-04-02 17:31:48 +00:00
public function sendMsg(string $message_type, int|string $target_id, string $message, bool $auto_escape): array|bool
2022-03-27 16:42:36 +08:00
```
### 描述
发送消息
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
2022-04-02 17:31:48 +00:00
| message_type | string | 消息类型 |
| target_id | int|string | 目标ID |
| message | string | 消息内容 |
| auto_escape | bool | 是否自动转义默认为false |
2022-04-01 18:48:48 +08:00
2022-03-27 16:42:36 +08:00
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| array|bool | 返回API调用结果数组或异步API调用状态bool |
2022-03-27 16:42:36 +08:00
## deleteMsg
```php
2022-04-02 17:31:48 +00:00
public function deleteMsg(int|string $message_id): array|bool
2022-03-27 16:42:36 +08:00
```
### 描述
撤回消息
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
2022-04-02 17:31:48 +00:00
| message_id | int|string | 消息ID |
2022-04-01 18:48:48 +08:00
2022-03-27 16:42:36 +08:00
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| array|bool | 返回API调用结果数组或异步API调用状态bool |
2022-03-27 16:42:36 +08:00
## getMsg
```php
2022-04-02 17:31:48 +00:00
public function getMsg(int|string $message_id): array|bool
2022-03-27 16:42:36 +08:00
```
### 描述
获取消息
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
2022-04-02 17:31:48 +00:00
| message_id | int|string | 消息ID |
2022-04-01 18:48:48 +08:00
2022-03-27 16:42:36 +08:00
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| array|bool | 返回API调用结果数组或异步API调用状态bool |
2022-03-27 16:42:36 +08:00
## getForwardMsg
```php
2022-04-02 17:31:48 +00:00
public function getForwardMsg(int|string $id): array|bool
2022-03-27 16:42:36 +08:00
```
### 描述
获取合并转发消息
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
2022-04-02 17:31:48 +00:00
| id | int|string | ID |
2022-04-01 18:48:48 +08:00
2022-03-27 16:42:36 +08:00
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| array|bool | 返回API调用结果数组或异步API调用状态bool |
2022-03-27 16:42:36 +08:00
## sendLike
```php
2022-04-02 17:31:48 +00:00
public function sendLike(int|string $user_id, int $times): array|bool
2022-03-27 16:42:36 +08:00
```
### 描述
发送好友赞
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
2022-04-02 17:31:48 +00:00
| user_id | int|string | 用户ID |
| times | int | 时间 |
2022-04-01 18:48:48 +08:00
2022-03-27 16:42:36 +08:00
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| array|bool | 返回API调用结果数组或异步API调用状态bool |
2022-03-27 16:42:36 +08:00
## setGroupKick
```php
2022-04-02 17:31:48 +00:00
public function setGroupKick(int|string $group_id, int|string $user_id, bool $reject_add_request): array|bool
2022-03-27 16:42:36 +08:00
```
### 描述
群组踢人
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
2022-04-02 17:31:48 +00:00
| group_id | int|string | 群ID |
| user_id | int|string | 用户ID |
2022-03-27 16:42:36 +08:00
| reject_add_request | bool | |
2022-04-01 18:48:48 +08:00
2022-03-27 16:42:36 +08:00
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| array|bool | 返回API调用结果数组或异步API调用状态bool |
2022-03-27 16:42:36 +08:00
## setGroupBan
```php
2022-04-02 17:31:48 +00:00
public function setGroupBan(int|string $group_id, int|string $user_id, int $duration): array|bool
2022-03-27 16:42:36 +08:00
```
### 描述
群组单人禁言
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
2022-04-02 17:31:48 +00:00
| group_id | int|string | 群ID |
| user_id | int|string | 用户ID |
| duration | int | 禁言时长 |
2022-04-01 18:48:48 +08:00
2022-03-27 16:42:36 +08:00
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| array|bool | 返回API调用结果数组或异步API调用状态bool |
2022-03-27 16:42:36 +08:00
## setGroupAnonymousBan
```php
2022-04-02 17:31:48 +00:00
public function setGroupAnonymousBan(int|string $group_id, array|int|string $anonymous_or_flag, int $duration): array|bool
2022-03-27 16:42:36 +08:00
```
### 描述
群组匿名用户禁言
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
2022-04-02 17:31:48 +00:00
| group_id | int|string | 群ID |
| anonymous_or_flag | array|int|string | 匿名禁言Flag或匿名用户对象 |
2022-03-27 16:42:36 +08:00
| duration | int | |
2022-04-01 18:48:48 +08:00
2022-03-27 16:42:36 +08:00
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| array|bool | 返回API调用结果数组或异步API调用状态bool |
2022-03-27 16:42:36 +08:00
## setGroupWholeBan
```php
2022-04-02 17:31:48 +00:00
public function setGroupWholeBan(int|string $group_id, bool $enable): array|bool
2022-03-27 16:42:36 +08:00
```
### 描述
群组全员禁言
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
2022-04-02 17:31:48 +00:00
| group_id | int|string | 群ID |
2022-03-27 16:42:36 +08:00
| enable | bool | |
2022-04-01 18:48:48 +08:00
2022-03-27 16:42:36 +08:00
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| array|bool | 返回API调用结果数组或异步API调用状态bool |
2022-03-27 16:42:36 +08:00
## setGroupAdmin
```php
2022-04-02 17:31:48 +00:00
public function setGroupAdmin(int|string $group_id, int|string $user_id, bool $enable): array|bool
2022-03-27 16:42:36 +08:00
```
### 描述
群组设置管理员
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
2022-04-02 17:31:48 +00:00
| group_id | int|string | 群ID |
| user_id | int|string | 用户ID |
2022-03-27 16:42:36 +08:00
| enable | bool | |
2022-04-01 18:48:48 +08:00
2022-03-27 16:42:36 +08:00
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| array|bool | 返回API调用结果数组或异步API调用状态bool |
2022-03-27 16:42:36 +08:00
## setGroupAnonymous
```php
2022-04-02 17:31:48 +00:00
public function setGroupAnonymous(int|string $group_id, bool $enable): array|bool
2022-03-27 16:42:36 +08:00
```
### 描述
群组匿名
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
2022-04-02 17:31:48 +00:00
| group_id | int|string | 群ID |
| enable | bool | 是否启用默认为true |
2022-04-01 18:48:48 +08:00
2022-03-27 16:42:36 +08:00
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| array|bool | 返回API调用结果数组或异步API调用状态bool |
2022-03-27 16:42:36 +08:00
## setGroupCard
```php
2022-04-02 17:31:48 +00:00
public function setGroupCard(int|string $group_id, int|string $user_id, string $card): array|bool
2022-03-27 16:42:36 +08:00
```
### 描述
设置群名片(群备注)
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
2022-04-02 17:31:48 +00:00
| group_id | int|string | 群ID |
| user_id | int|string | 用户ID |
| card | string | 名片内容(默认为空) |
2022-04-01 18:48:48 +08:00
2022-03-27 16:42:36 +08:00
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| array|bool | 返回API调用结果数组或异步API调用状态bool |
2022-03-27 16:42:36 +08:00
## setGroupName
```php
2022-04-02 17:31:48 +00:00
public function setGroupName(int|string $group_id, string $group_name): array|bool
2022-03-27 16:42:36 +08:00
```
### 描述
设置群名
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
2022-04-02 17:31:48 +00:00
| group_id | int|string | 群ID |
| group_name | string | 群名 |
2022-04-01 18:48:48 +08:00
2022-03-27 16:42:36 +08:00
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| array|bool | 返回API调用结果数组或异步API调用状态bool |
2022-03-27 16:42:36 +08:00
## setGroupLeave
```php
2022-04-02 17:31:48 +00:00
public function setGroupLeave(int|string $group_id, bool $is_dismiss): array|bool
2022-03-27 16:42:36 +08:00
```
### 描述
退出群组
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
2022-04-02 17:31:48 +00:00
| group_id | int|string | 群ID |
| is_dismiss | bool | 是否解散默认为false |
2022-04-01 18:48:48 +08:00
2022-03-27 16:42:36 +08:00
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| array|bool | 返回API调用结果数组或异步API调用状态bool |
2022-03-27 16:42:36 +08:00
## setGroupSpecialTitle
```php
2022-04-02 17:31:48 +00:00
public function setGroupSpecialTitle(int|string $group_id, int|string $user_id, string $special_title, int $duration): array|bool
2022-03-27 16:42:36 +08:00
```
### 描述
设置群组专属头衔
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
2022-04-02 17:31:48 +00:00
| group_id | int|string | 群ID |
| user_id | int|string | 用户ID |
| special_title | string | 专属头衔内容 |
| duration | int | 持续时间(默认为-1永久 |
2022-04-01 18:48:48 +08:00
2022-03-27 16:42:36 +08:00
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| array|bool | 返回API调用结果数组或异步API调用状态bool |
2022-03-27 16:42:36 +08:00
## setFriendAddRequest
```php
2022-04-02 17:31:48 +00:00
public function setFriendAddRequest(array|int|string $flag, bool $approve, string $remark): array|bool
2022-03-27 16:42:36 +08:00
```
### 描述
处理加好友请求
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
2022-04-02 17:31:48 +00:00
| flag | array|int|string | 处理加好友请求的flag |
| approve | bool | 是否同意默认为true |
| remark | string | 设置昵称(默认不设置) |
2022-04-01 18:48:48 +08:00
2022-03-27 16:42:36 +08:00
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| array|bool | 返回API调用结果数组或异步API调用状态bool |
2022-03-27 16:42:36 +08:00
## setGroupAddRequest
```php
2022-04-02 17:31:48 +00:00
public function setGroupAddRequest(array|int|string $flag, string $sub_type, bool $approve, string $reason): array|bool
2022-03-27 16:42:36 +08:00
```
### 描述
处理加群请求/邀请
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
2022-04-02 17:31:48 +00:00
| flag | array|int|string | 处理加群请求的flag |
| sub_type | string | 处理请求类型包含add和invite |
| approve | bool | 是否同意默认为true |
| reason | string | 拒绝理由(仅在拒绝时有效,默认为空) |
2022-04-01 18:48:48 +08:00
2022-03-27 16:42:36 +08:00
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| array|bool | 返回API调用结果数组或异步API调用状态bool |
2022-03-27 16:42:36 +08:00
## getLoginInfo
```php
2022-04-02 17:31:48 +00:00
public function getLoginInfo(): array|bool
2022-03-27 16:42:36 +08:00
```
### 描述
获取登录号信息
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| array|bool | 返回API调用结果数组或异步API调用状态bool |
2022-03-27 16:42:36 +08:00
## getStrangerInfo
```php
2022-04-02 17:31:48 +00:00
public function getStrangerInfo(int|string $user_id, bool $no_cache): array|bool
2022-03-27 16:42:36 +08:00
```
### 描述
获取陌生人信息
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
2022-04-02 17:31:48 +00:00
| user_id | int|string | 用户ID |
| no_cache | bool | 是否不使用缓存默认为false |
2022-04-01 18:48:48 +08:00
2022-03-27 16:42:36 +08:00
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| array|bool | 返回API调用结果数组或异步API调用状态bool |
2022-03-27 16:42:36 +08:00
## getFriendList
```php
2022-04-02 17:31:48 +00:00
public function getFriendList(): array|bool
2022-03-27 16:42:36 +08:00
```
### 描述
获取好友列表
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| array|bool | 返回API调用结果数组或异步API调用状态bool |
2022-03-27 16:42:36 +08:00
## getGroupInfo
```php
2022-04-02 17:31:48 +00:00
public function getGroupInfo(int|string $group_id, bool $no_cache): array|bool
2022-03-27 16:42:36 +08:00
```
### 描述
获取群信息
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
2022-04-02 17:31:48 +00:00
| group_id | int|string | 群ID |
2022-03-27 16:42:36 +08:00
| no_cache | bool | |
2022-04-01 18:48:48 +08:00
2022-03-27 16:42:36 +08:00
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| array|bool | 返回API调用结果数组或异步API调用状态bool |
2022-03-27 16:42:36 +08:00
## getGroupList
```php
2022-04-02 17:31:48 +00:00
public function getGroupList(): array|bool
2022-03-27 16:42:36 +08:00
```
### 描述
获取群列表
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| array|bool | 返回API调用结果数组或异步API调用状态bool |
2022-03-27 16:42:36 +08:00
## getGroupMemberInfo
```php
2022-04-02 17:31:48 +00:00
public function getGroupMemberInfo(int|string $group_id, int|string $user_id, bool $no_cache): array|bool
2022-03-27 16:42:36 +08:00
```
### 描述
获取群成员信息
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
2022-04-02 17:31:48 +00:00
| group_id | int|string | 群ID |
| user_id | int|string | 用户ID |
2022-03-27 16:42:36 +08:00
| no_cache | bool | |
2022-04-01 18:48:48 +08:00
2022-03-27 16:42:36 +08:00
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| array|bool | 返回API调用结果数组或异步API调用状态bool |
2022-03-27 16:42:36 +08:00
## getGroupMemberList
```php
2022-04-02 17:31:48 +00:00
public function getGroupMemberList(int|string $group_id): array|bool
2022-03-27 16:42:36 +08:00
```
### 描述
获取群成员列表
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
2022-04-02 17:31:48 +00:00
| group_id | int|string | 群ID |
2022-04-01 18:48:48 +08:00
2022-03-27 16:42:36 +08:00
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| array|bool | 返回API调用结果数组或异步API调用状态bool |
2022-03-27 16:42:36 +08:00
## getGroupHonorInfo
```php
2022-04-02 17:31:48 +00:00
public function getGroupHonorInfo(int|string $group_id, string $type): array|bool
2022-03-27 16:42:36 +08:00
```
### 描述
获取群荣誉信息
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
2022-04-02 17:31:48 +00:00
| group_id | int|string | 群ID |
| type | string | 荣誉类型 |
2022-04-01 18:48:48 +08:00
2022-03-27 16:42:36 +08:00
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| array|bool | 返回API调用结果数组或异步API调用状态bool |
2022-03-27 16:42:36 +08:00
## getCsrfToken
```php
2022-04-02 17:31:48 +00:00
public function getCsrfToken(): array|bool
2022-03-27 16:42:36 +08:00
```
### 描述
获取 CSRF Token
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| array|bool | 返回API调用结果数组或异步API调用状态bool |
2022-03-27 16:42:36 +08:00
## getCredentials
```php
2022-04-02 17:31:48 +00:00
public function getCredentials(string $domain): array|bool
2022-03-27 16:42:36 +08:00
```
### 描述
获取 QQ 相关接口凭证
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| domain | string | |
2022-04-01 18:48:48 +08:00
2022-03-27 16:42:36 +08:00
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| array|bool | 返回API调用结果数组或异步API调用状态bool |
2022-03-27 16:42:36 +08:00
## getRecord
```php
2022-04-02 17:31:48 +00:00
public function getRecord(string $file, string $out_format): array|bool
2022-03-27 16:42:36 +08:00
```
### 描述
获取语音
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
2022-04-02 17:31:48 +00:00
| file | string | 文件 |
| out_format | string | 输出格式 |
2022-04-01 18:48:48 +08:00
2022-03-27 16:42:36 +08:00
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| array|bool | 返回API调用结果数组或异步API调用状态bool |
2022-03-27 16:42:36 +08:00
## getImage
```php
2022-04-02 17:31:48 +00:00
public function getImage(string $file): array|bool
2022-03-27 16:42:36 +08:00
```
### 描述
获取图片
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
2022-04-02 17:31:48 +00:00
| file | string | 文件 |
2022-04-01 18:48:48 +08:00
2022-03-27 16:42:36 +08:00
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| array|bool | 返回API调用结果数组或异步API调用状态bool |
2022-03-27 16:42:36 +08:00
## canSendImage
```php
2022-04-02 17:31:48 +00:00
public function canSendImage(): array|bool
2022-03-27 16:42:36 +08:00
```
### 描述
检查是否可以发送图片
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| array|bool | 返回API调用结果数组或异步API调用状态bool |
2022-03-27 16:42:36 +08:00
## canSendRecord
```php
2022-04-02 17:31:48 +00:00
public function canSendRecord(): array|bool
2022-03-27 16:42:36 +08:00
```
### 描述
检查是否可以发送语音
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| array|bool | 返回API调用结果数组或异步API调用状态bool |
2022-03-27 16:42:36 +08:00
## getStatus
```php
2022-04-02 17:31:48 +00:00
public function getStatus(): array|bool
2022-03-27 16:42:36 +08:00
```
### 描述
获取运行状态
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| array|bool | 返回API调用结果数组或异步API调用状态bool |
2022-03-27 16:42:36 +08:00
## getVersionInfo
```php
2022-04-02 17:31:48 +00:00
public function getVersionInfo(): array|bool
2022-03-27 16:42:36 +08:00
```
### 描述
获取版本信息
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| array|bool | 返回API调用结果数组或异步API调用状态bool |
2022-03-27 16:42:36 +08:00
## setRestart
```php
2022-04-02 17:31:48 +00:00
public function setRestart(int $delay): array|bool
2022-03-27 16:42:36 +08:00
```
### 描述
重启 OneBot 实现
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
2022-04-02 17:31:48 +00:00
| delay | int | 延迟时间毫秒默认为0 |
2022-04-01 18:48:48 +08:00
2022-03-27 16:42:36 +08:00
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| array|bool | 返回API调用结果数组或异步API调用状态bool |
2022-03-27 16:42:36 +08:00
## cleanCache
```php
2022-04-02 17:31:48 +00:00
public function cleanCache(): array|bool
2022-03-27 16:42:36 +08:00
```
### 描述
清理缓存
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| array|bool | 返回API调用结果数组或异步API调用状态bool |
2022-03-27 16:42:36 +08:00
## getExtendedAPI
```php
public function getExtendedAPI(string $package_name): mixed
```
### 描述
获取内置支持的扩展API对象
现支持 go-cqhttp 的扩展API
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| package_name | string | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
2022-04-02 17:31:48 +00:00
| mixed | 返回包的操作对象 |
## callExtendedAPI
```php
public function callExtendedAPI(string $action, array $params): array|bool
```
### 描述
作者很懒,什么也没有说
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| action | string | 动作API名称 |
| params | array | 参数 |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| array|bool | 返回API调用结果数组或异步API调用状态bool |