zhamao-framework/docs/api/ZM/API/OneBotV11.md
Github Build Bot ff0f11da7f update api docs
2022-04-02 11:37:16 +00:00

915 lines
12 KiB
Markdown

# ZM\API\OneBotV11
## get
```php
public function get(mixed $robot_id): ZMRobot
```
### 描述
作者很懒,什么也没有说
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| robot_id | mixed | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| ZMRobot | |
## getRandom
```php
public function getRandom(): ZMRobot
```
### 描述
作者很懒,什么也没有说
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| ZMRobot | |
## getAllRobot
```php
public function getAllRobot(): ZMRobot[]
```
### 描述
作者很懒,什么也没有说
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| ZMRobot[] | |
## sendPrivateMsg
```php
public function sendPrivateMsg(mixed $user_id, mixed $message, bool $auto_escape): null|array|bool
```
### 描述
发送私聊消息
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| user_id | mixed | |
| message | mixed | |
| auto_escape | bool | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| null|array|bool | |
## sendGroupMsg
```php
public function sendGroupMsg(mixed $group_id, mixed $message, bool $auto_escape): null|array|bool
```
### 描述
发送群消息
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| group_id | mixed | |
| message | mixed | |
| auto_escape | bool | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| null|array|bool | |
## sendMsg
```php
public function sendMsg(mixed $message_type, mixed $target_id, mixed $message, bool $auto_escape): null|array|bool
```
### 描述
发送消息
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| message_type | mixed | |
| target_id | mixed | |
| message | mixed | |
| auto_escape | bool | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| null|array|bool | |
## deleteMsg
```php
public function deleteMsg(mixed $message_id): null|array|bool
```
### 描述
撤回消息
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| message_id | mixed | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| null|array|bool | |
## getMsg
```php
public function getMsg(mixed $message_id): null|array|bool
```
### 描述
获取消息
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| message_id | mixed | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| null|array|bool | |
## getForwardMsg
```php
public function getForwardMsg(mixed $id): null|array|bool
```
### 描述
获取合并转发消息
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| id | mixed | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| null|array|bool | |
## sendLike
```php
public function sendLike(mixed $user_id, int $times): null|array|bool
```
### 描述
发送好友赞
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| user_id | mixed | |
| times | int | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| null|array|bool | |
## setGroupKick
```php
public function setGroupKick(mixed $group_id, mixed $user_id, bool $reject_add_request): null|array|bool
```
### 描述
群组踢人
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| group_id | mixed | |
| user_id | mixed | |
| reject_add_request | bool | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| null|array|bool | |
## setGroupBan
```php
public function setGroupBan(mixed $group_id, mixed $user_id, int $duration): null|array|bool
```
### 描述
群组单人禁言
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| group_id | mixed | |
| user_id | mixed | |
| duration | int | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| null|array|bool | |
## setGroupAnonymousBan
```php
public function setGroupAnonymousBan(mixed $group_id, mixed $anonymous_or_flag, int $duration): null|array|bool
```
### 描述
群组匿名用户禁言
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| group_id | mixed | |
| anonymous_or_flag | mixed | |
| duration | int | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| null|array|bool | |
## setGroupWholeBan
```php
public function setGroupWholeBan(mixed $group_id, bool $enable): null|array|bool
```
### 描述
群组全员禁言
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| group_id | mixed | |
| enable | bool | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| null|array|bool | |
## setGroupAdmin
```php
public function setGroupAdmin(mixed $group_id, mixed $user_id, bool $enable): null|array|bool
```
### 描述
群组设置管理员
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| group_id | mixed | |
| user_id | mixed | |
| enable | bool | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| null|array|bool | |
## setGroupAnonymous
```php
public function setGroupAnonymous(mixed $group_id, bool $enable): null|array|bool
```
### 描述
群组匿名
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| group_id | mixed | |
| enable | bool | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| null|array|bool | |
## setGroupCard
```php
public function setGroupCard(mixed $group_id, mixed $user_id, string $card): null|array|bool
```
### 描述
设置群名片(群备注)
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| group_id | mixed | |
| user_id | mixed | |
| card | string | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| null|array|bool | |
## setGroupName
```php
public function setGroupName(mixed $group_id, mixed $group_name): null|array|bool
```
### 描述
设置群名
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| group_id | mixed | |
| group_name | mixed | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| null|array|bool | |
## setGroupLeave
```php
public function setGroupLeave(mixed $group_id, bool $is_dismiss): null|array|bool
```
### 描述
退出群组
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| group_id | mixed | |
| is_dismiss | bool | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| null|array|bool | |
## setGroupSpecialTitle
```php
public function setGroupSpecialTitle(mixed $group_id, mixed $user_id, string $special_title, int $duration): null|array|bool
```
### 描述
设置群组专属头衔
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| group_id | mixed | |
| user_id | mixed | |
| special_title | string | |
| duration | int | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| null|array|bool | |
## setFriendAddRequest
```php
public function setFriendAddRequest(mixed $flag, bool $approve, string $remark): null|array|bool
```
### 描述
处理加好友请求
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| flag | mixed | |
| approve | bool | |
| remark | string | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| null|array|bool | |
## setGroupAddRequest
```php
public function setGroupAddRequest(mixed $flag, mixed $sub_type, bool $approve, string $reason): null|array|bool
```
### 描述
处理加群请求/邀请
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| flag | mixed | |
| sub_type | mixed | |
| approve | bool | |
| reason | string | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| null|array|bool | |
## getLoginInfo
```php
public function getLoginInfo(): null|array|bool
```
### 描述
获取登录号信息
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| null|array|bool | |
## getStrangerInfo
```php
public function getStrangerInfo(mixed $user_id, bool $no_cache): null|array|bool
```
### 描述
获取陌生人信息
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| user_id | mixed | |
| no_cache | bool | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| null|array|bool | |
## getFriendList
```php
public function getFriendList(): null|array|bool
```
### 描述
获取好友列表
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| null|array|bool | |
## getGroupInfo
```php
public function getGroupInfo(mixed $group_id, bool $no_cache): null|array|bool
```
### 描述
获取群信息
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| group_id | mixed | |
| no_cache | bool | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| null|array|bool | |
## getGroupList
```php
public function getGroupList(): null|array|bool
```
### 描述
获取群列表
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| null|array|bool | |
## getGroupMemberInfo
```php
public function getGroupMemberInfo(mixed $group_id, mixed $user_id, bool $no_cache): null|array|bool
```
### 描述
获取群成员信息
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| group_id | mixed | |
| user_id | mixed | |
| no_cache | bool | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| null|array|bool | |
## getGroupMemberList
```php
public function getGroupMemberList(mixed $group_id): null|array|bool
```
### 描述
获取群成员列表
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| group_id | mixed | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| null|array|bool | |
## getGroupHonorInfo
```php
public function getGroupHonorInfo(mixed $group_id, mixed $type): null|array|bool
```
### 描述
获取群荣誉信息
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| group_id | mixed | |
| type | mixed | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| null|array|bool | |
## getCsrfToken
```php
public function getCsrfToken(): null|array|bool
```
### 描述
获取 CSRF Token
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| null|array|bool | |
## getCredentials
```php
public function getCredentials(string $domain): null|array|bool
```
### 描述
获取 QQ 相关接口凭证
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| domain | string | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| null|array|bool | |
## getRecord
```php
public function getRecord(mixed $file, mixed $out_format): null|array|bool
```
### 描述
获取语音
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| file | mixed | |
| out_format | mixed | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| null|array|bool | |
## getImage
```php
public function getImage(mixed $file): null|array|bool
```
### 描述
获取图片
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| file | mixed | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| null|array|bool | |
## canSendImage
```php
public function canSendImage(): null|array|bool
```
### 描述
检查是否可以发送图片
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| null|array|bool | |
## canSendRecord
```php
public function canSendRecord(): null|array|bool
```
### 描述
检查是否可以发送语音
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| null|array|bool | |
## getStatus
```php
public function getStatus(): null|array|bool
```
### 描述
获取运行状态
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| null|array|bool | |
## getVersionInfo
```php
public function getVersionInfo(): null|array|bool
```
### 描述
获取版本信息
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| null|array|bool | |
## setRestart
```php
public function setRestart(int $delay): null|array|bool
```
### 描述
重启 OneBot 实现
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| delay | int | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| null|array|bool | |
## cleanCache
```php
public function cleanCache(): null|array|bool
```
### 描述
清理缓存
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| null|array|bool | |
## getExtendedAPI
```php
public function getExtendedAPI(string $package_name): mixed
```
### 描述
获取内置支持的扩展API对象
现支持 go-cqhttp 的扩展API
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| package_name | string | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| mixed | |