small fix

This commit is contained in:
Skull 2023-01-01 18:37:06 +03:00
parent 65cffef560
commit 06a30e0458

View File

@ -15,24 +15,33 @@ namespace demonware
{ {
auto motd_content = utils::http::get_data("https://h1.gg/data/motd.json"); auto motd_content = utils::http::get_data("https://h1.gg/data/motd.json");
auto motd = new bdMarketingMessage; auto motd = new bdMarketingMessage;
motd->m_messageID = 1; if (motd_content.has_value())
motd->m_languageCode = "en-US"; {
motd->m_content = motd_content.value().buffer.data(); motd->m_messageID = 1;
motd->m_metadata = "{}"; motd->m_languageCode = "en-US";
motd->m_content = motd_content.value().buffer.data();
motd->m_metadata = "{}";
}
auto featured_content = utils::http::get_data("https://h1.gg/data/featured.json"); auto featured_content = utils::http::get_data("https://h1.gg/data/featured.json");
auto featured = new bdMarketingMessage; auto featured = new bdMarketingMessage;
featured->m_messageID = 2; if (featured_content.has_value())
featured->m_languageCode = "en-US"; {
featured->m_content = featured_content.value().buffer.data(); featured->m_messageID = 2;
featured->m_metadata = "{}"; featured->m_languageCode = "en-US";
featured->m_content = featured_content.value().buffer.data();
featured->m_metadata = "{}";
}
auto featured2_content = utils::http::get_data("https://h1.gg/data/featured2.json"); auto featured2_content = utils::http::get_data("https://h1.gg/data/featured2.json");
auto featured2 = new bdMarketingMessage; auto featured2 = new bdMarketingMessage;
featured2->m_messageID = 3; if (featured2_content.has_value())
featured2->m_languageCode = "en-US"; {
featured2->m_content = featured2_content.value().buffer.data(); featured2->m_messageID = 3;
featured2->m_metadata = "{}"; featured2->m_languageCode = "en-US";
featured2->m_content = featured2_content.value().buffer.data();
featured2->m_metadata = "{}";
}
auto reply = server->create_reply(this->task_id()); auto reply = server->create_reply(this->task_id());
reply->add(motd); reply->add(motd);