This repository was archived by the owner on Aug 16, 2024. It is now read-only.

Description
改函数方法里,当http回复
"{"code":5,"msg":"指定对象不存在"}"
时,未捕获code值,直接使用json获取name
该函数代码如下
GroupMemberInfo MiraiBot::GetGroupMemberInfo(GID_t gid, QQ_t memberId)
{
stringstream api_url;
api_url
<< "/memberInfo?sessionKey="
<< sessionKey_
<< "&target="
<< int64_t(gid)
<< "&memberId="
<< int64_t(memberId);
auto res = http_client_.Get(api_url.str().data());
if (!res)
throw std::runtime_error("网络错误");
if (res->status != 200)
throw std::runtime_error("[mirai-api-http error]: " + res->body);
json re_json = json::parse(res->body);
GroupMemberInfo result;
result.Set(re_json);
return result;
}