feat: add initial experimental Twitch Eventsub support (#5837)

Co-authored-by: nerix <nerixdev@outlook.de>
This commit is contained in:
pajlada
2025-02-02 17:03:24 +01:00
committed by GitHub
parent f9f7d47b43
commit 0f8a29fdb9
130 changed files with 19656 additions and 8 deletions
+27
View File
@@ -0,0 +1,27 @@
#include "twitch-eventsub-ws/chrono.hpp"
#include "twitch-eventsub-ws/date.h"
#include <sstream>
namespace chatterino::eventsub::lib {
boost::json::result_for<std::chrono::system_clock::time_point,
boost::json::value>::type
tag_invoke(
boost::json::try_value_to_tag<std::chrono::system_clock::time_point>,
const boost::json::value &jvRoot, const AsISO8601 &)
{
const auto raw = boost::json::try_value_to<std::string>(jvRoot);
if (raw.has_error())
{
return raw.error();
}
std::chrono::system_clock::time_point tp;
std::istringstream in{*raw};
in >> date::parse("%FT%TZ", tp);
return tp;
}
} // namespace chatterino::eventsub::lib