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

Commit 9506e37

Browse files
authored
Merge pull request #61 from cyanray/dev/cyanray
Release 1.8.4;
2 parents 2d18139 + ad84023 commit 9506e37

File tree

3 files changed

+15
-25
lines changed

3 files changed

+15
-25
lines changed

examples/RepeatMessage.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ int main()
1919
// 检查一下版本
2020
try
2121
{
22-
// 获取 mirai-api-http 插件地版本
23-
string current_version = bot.GetApiVersion();
24-
// 获取 mirai-cpp 适配的版本
25-
string required_version = bot.GetRequiredApiVersion();
26-
cout << "! 需要的 API 版本: " << required_version
27-
<< "; 当前 API 版本: " << current_version << "; " << endl;
28-
if (current_version != required_version)
22+
// 获取 mirai-api-http 插件的版本
23+
string mah_version = bot.GetMiraiApiHttpVersion();
24+
// 获取 mirai-cpp 的版本
25+
string mc_version = bot.GetMiraiCppVersion();
26+
cout << "! mirai-api-http 的版本: " << mah_version
27+
<< "; 当mirai-cpp 的版本: " << mc_version << "; " << endl;
28+
if (mah_version != mc_version)
2929
{
30-
cout << "! 警告: 你的 mirai-api-http 插件的版本与 mirai-cpp 适配的版本不同,可能存在潜在的异常" << endl;
30+
cout << "! 警告: 你的 mirai-api-http 插件的版本与 mirai-cpp 的版本不同,可能存在兼容性问题" << endl;
3131
}
3232
}
3333
catch (const std::exception& ex)

include/mirai/mirai_bot.hpp

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -65,30 +65,20 @@ namespace Cyan
6565
~MiraiBot();
6666

6767
/**
68-
* \brief 获得 mirai-cpp 适配的 API 版本
69-
* \return 用数字表示的版本号 (10605)
68+
* \brief 获得 mirai-cpp 的版本号
69+
* \return 用字符串表示的版本号,如:"1.6.5"
7070
*/
71-
int GetRequiredApiVersionInt() const
71+
string GetMiraiCppVersion() const
7272
{
7373
// mirai-api-http v1.6.5
74-
return 10800;
75-
}
76-
77-
/**
78-
* \brief 获得 mirai-cpp 适配的 API 版本
79-
* \return 用字符串表示的版本号(v1.6.5)
80-
*/
81-
string GetRequiredApiVersion() const
82-
{
83-
// mirai-api-http v1.6.5
84-
return "v1.8.0";
74+
return "1.8.4";
8575
}
8676

8777
/**
8878
* \brief 获得 mirai-api-http 插件的版本
89-
* \return 用字符串表示的版本号(v1.6.5)
79+
* \return 用字符串表示的版本号,如:"1.6.5"
9080
*/
91-
string GetApiVersion();
81+
string GetMiraiApiHttpVersion();
9282
/**
9383
* \brief 获得验证后的 SessionKey
9484
* \return SessionKey

src/mirai_bot.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ namespace Cyan
5151
return &(this->http_client_);
5252
}
5353

54-
string MiraiBot::GetApiVersion()
54+
string MiraiBot::GetMiraiApiHttpVersion()
5555
{
5656

5757
auto res = http_client_.Get("/about");

0 commit comments

Comments
 (0)