功能类
设置好友备注
set_friend_remark:设置或清除好友备注。
const SetFriendRemarkResult *set_friend_remark(
uint64_t self_id, const char *platform, uint64_t user_id, const char *remark);
void free_set_friend_remark_result(const SetFriendRemarkResult *result);- 权限:
set_friend_remark - 调用要求:需要账号在线,请在工作线程中调用
参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
self_id | uint64_t | 是 | 在线 Bot QQ 号 |
platform | const char * | 是 | 所属平台 PLATFORM_* |
user_id | uint64_t | 是 | 好友 QQ 号;尚未取得该好友信息时先调用 list_friends |
remark | const char * | 否 | UTF-8 新备注,传 "" 或 NULL 清除备注 |
返回值 SetFriendRemarkResult
可通过 remark_changed 事件获知备注更新。用完必须调用 free_set_friend_remark_result(result) 交还。
| 字段 | 类型 | 说明 |
|---|---|---|
code | int32_t | 0 表示成功;服务器拒绝时原样保留服务端结果码,本地失败为 RESULT_LOCAL_ERROR(-1) |
error | const char * | 失败原因,非 NULL,无内容时为 "" |