账号管理
获取 Bot 信息
get_bot_info:查询指定账号的 Bot 信息。
const BotInfoResult *get_bot_info(uint64_t self_id, const char *platform);
void free_bot_info(const BotInfoResult *result);- 权限:
get_bot_info - 调用要求:无需账号在线
参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
self_id | uint64_t | 是 | 目标 Bot 的 QQ 号 |
platform | const char * | 是 | 所属平台 PLATFORM_* |
返回值 BotInfoResult
账号不存在时返回 code != 0,msg 写明原因;非 NULL 不代表查询成功,失败时不要读取其他资料字段。用完必须调用 free_bot_info(result) 交还。
| 字段 | 类型 | 说明 |
|---|---|---|
code | int32_t | 0 表示成功 |
msg | const char * | 失败原因,无内容时为 "" |
nickname | const char * | 昵称 |
level | int32_t | QQ 等级,未取得时为 -1 |
received | uint64_t | 本次上线以来收到的聊天消息数 |
sent | uint64_t | 本次上线以来成功发出的聊天消息数 |
online_since | uint64_t | 本次上线时间(Unix 秒),不在线时为 0 |
platform | const char * | 所属平台 PLATFORM_* |
protocol | const char * | 当前协议 PROTOCOL_* |
status | int32_t | 账号状态 ACCOUNT_* |
note | const char * | 附加信息 |