Skip to content

Commit

Permalink
fix compiling errors on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Slontia committed Dec 26, 2021
1 parent 220b720 commit 4ad7999
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,15 @@ void MessagerPostUser(void* p, uint64_t uid, bool is_at)
}
}

void MessagerPostImage(void* p, const char* path)
void MessagerPostImage(void* p, const std::filesystem::path::value_type* path)
{
Messager* const messager = static_cast<Messager*>(p);
std::basic_string<std::filesystem::path::value_type> path_str(path);
if (messager->is_uid_) {
auto img = g_mirai_bot->UploadFriendImage(path);
auto img = g_mirai_bot->UploadFriendImage(std::string(path_str.begin(), path_str.end()));
messager->msg_.Image(img);
} else {
auto img = g_mirai_bot->UploadGroupImage(path);
auto img = g_mirai_bot->UploadGroupImage(std::string(path_str.begin(), path_str.end()));
messager->msg_.Image(img);
}
}
Expand Down Expand Up @@ -163,7 +164,7 @@ int main(int argc, char** argv)
.game_path_ = FLAGS_game_path.c_str(),
.image_path_ = FLAGS_image_path.c_str(),
.admins_ = admins.data(),
.db_path_ = FLAGS_db_path.c_str()
.db_path_ = std::filesystem::path(FLAGS_db_path).c_str(),
};
const std::unique_ptr<void, void(*)(void*)> bot_core(BOT_API::Init(&option), BOT_API::Release);
if (!bot_core) {
Expand Down

0 comments on commit 4ad7999

Please sign in to comment.