This repository was archived by the owner on Aug 16, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-16
lines changed
Expand file tree Collapse file tree 1 file changed +8
-16
lines changed Original file line number Diff line number Diff line change @@ -65,15 +65,11 @@ namespace Cyan
6565
6666 httplib::Client& http_client = *(bot_->GetHttpClient ());
6767 auto res = http_client.Post (" /resp/newFriendRequestEvent" , data.dump (), " application/json;charset=UTF-8" );
68- if (res)
69- {
70- if (res->status != 200 )
71- throw std::runtime_error (" [mirai-api-http error]: " + res->body );
72- return true ;
73- }
74- else
68+ if (!res)
7569 throw std::runtime_error (" 网络错误" );
76-
70+ if (res->status != 200 )
71+ throw std::runtime_error (" [mirai-api-http error]: " + res->body );
72+ return true ;
7773 }
7874
7975 bool MemberJoinRequestEvent::Respose (int operate, const string& message)
@@ -91,15 +87,11 @@ namespace Cyan
9187
9288 httplib::Client& http_client = *(bot_->GetHttpClient ());
9389 auto res = http_client.Post (" /resp/memberJoinRequestEvent" , data.dump (), " application/json;charset=UTF-8" );
94- if (res)
95- {
96- if (res->status != 200 )
97- throw std::runtime_error (" [mirai-api-http error]: " + res->body );
98- return true ;
99- }
100- else
90+ if (!res)
10191 throw std::runtime_error (" 网络错误" );
102-
92+ if (res->status != 200 )
93+ throw std::runtime_error (" [mirai-api-http error]: " + res->body );
94+ return true ;
10395 }
10496
10597}
You can’t perform that action at this time.
0 commit comments