Skip to content

Commit

Permalink
fix cq at
Browse files Browse the repository at this point in the history
  • Loading branch information
super1207 committed Aug 13, 2024
1 parent c45af0d commit 0569ff5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/MiraiCQ/MiraiCQ/center/event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,13 @@ static bool deal_json_array(Json::Value & json_arr)
Json::Value id_json = node["data"]["id"];
node["data"]["id"] = MsgIdTool::getInstance()->to_cqid(id_json);
}
else if (type_str == "at")
{
/* 只保留qq */
Json::Value data;
data["qq"] = node["data"]["qq"];
node["data"] = data;
}
//else if (type_str == "face")
//{
// // [CQ:face,id=324,type=sticker] -> [CQ:face,id=324]
Expand Down
4 changes: 2 additions & 2 deletions src/MiraiCQ/MiraiCQ/tool/StrTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@ int64_t StrTool::get_int64_from_json(const Json::Value& json, const std::string&
{
return json_value.asInt64();
}
else if (json_value.isString()) {
else if (json_value.isString()) {
try {
return std::stoll(json_value.asString());
}
catch (const std::exception& e) {
catch (const std::exception&) {
return default_value;
}
}
Expand Down

0 comments on commit 0569ff5

Please sign in to comment.