跳转到正文
账号管理

获取 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_iduint64_t是目标 Bot 的 QQ 号
platformconst char *是所属平台 PLATFORM_*

返回值 BotInfoResult

账号不存在时返回 code != 0,msg 写明原因;非 NULL 不代表查询成功,失败时不要读取其他资料字段。用完必须调用 free_bot_info(result) 交还。

字段类型说明
codeint32_t0 表示成功
msgconst char *失败原因,无内容时为 ""
nicknameconst char *昵称
levelint32_tQQ 等级,未取得时为 -1
receiveduint64_t本次上线以来收到的聊天消息数
sentuint64_t本次上线以来成功发出的聊天消息数
online_sinceuint64_t本次上线时间(Unix 秒),不在线时为 0
platformconst char *所属平台 PLATFORM_*
protocolconst char *当前协议 PROTOCOL_*
statusint32_t账号状态 ACCOUNT_*
noteconst char *附加信息

本页目录