feat(eventsub): implement automod message update (#6010)
This commit is contained in:
+5
-4
@@ -3,6 +3,7 @@
|
||||
#include "twitch-eventsub-ws/payloads/automod-message.hpp"
|
||||
#include "twitch-eventsub-ws/payloads/structured-message.hpp"
|
||||
#include "twitch-eventsub-ws/payloads/subscription.hpp"
|
||||
#include "twitch-eventsub-ws/string.hpp"
|
||||
|
||||
#include <boost/json.hpp>
|
||||
|
||||
@@ -12,9 +13,9 @@ namespace chatterino::eventsub::lib::payload::automod_message_update::v2 {
|
||||
|
||||
struct Event {
|
||||
// Broadcaster of the channel the message was sent in
|
||||
std::string broadcasterUserID;
|
||||
std::string broadcasterUserLogin;
|
||||
std::string broadcasterUserName;
|
||||
String broadcasterUserID;
|
||||
String broadcasterUserLogin;
|
||||
String broadcasterUserName;
|
||||
|
||||
// User who sent the message
|
||||
std::string userID;
|
||||
@@ -26,7 +27,7 @@ struct Event {
|
||||
std::string moderatorUserLogin;
|
||||
std::string moderatorUserName;
|
||||
|
||||
std::string messageID;
|
||||
String messageID;
|
||||
chat::Message message;
|
||||
|
||||
// "Approved", "Denied", or "Expired"
|
||||
|
||||
@@ -25,7 +25,7 @@ boost::json::result_for<Event, boost::json::value>::type tag_invoke(
|
||||
}
|
||||
|
||||
auto broadcasterUserID =
|
||||
boost::json::try_value_to<std::string>(*jvbroadcasterUserID);
|
||||
boost::json::try_value_to<String>(*jvbroadcasterUserID);
|
||||
|
||||
if (broadcasterUserID.has_error())
|
||||
{
|
||||
@@ -40,7 +40,7 @@ boost::json::result_for<Event, boost::json::value>::type tag_invoke(
|
||||
}
|
||||
|
||||
auto broadcasterUserLogin =
|
||||
boost::json::try_value_to<std::string>(*jvbroadcasterUserLogin);
|
||||
boost::json::try_value_to<String>(*jvbroadcasterUserLogin);
|
||||
|
||||
if (broadcasterUserLogin.has_error())
|
||||
{
|
||||
@@ -55,7 +55,7 @@ boost::json::result_for<Event, boost::json::value>::type tag_invoke(
|
||||
}
|
||||
|
||||
auto broadcasterUserName =
|
||||
boost::json::try_value_to<std::string>(*jvbroadcasterUserName);
|
||||
boost::json::try_value_to<String>(*jvbroadcasterUserName);
|
||||
|
||||
if (broadcasterUserName.has_error())
|
||||
{
|
||||
@@ -149,7 +149,7 @@ boost::json::result_for<Event, boost::json::value>::type tag_invoke(
|
||||
EVENTSUB_BAIL_HERE(error::Kind::FieldMissing);
|
||||
}
|
||||
|
||||
auto messageID = boost::json::try_value_to<std::string>(*jvmessageID);
|
||||
auto messageID = boost::json::try_value_to<String>(*jvmessageID);
|
||||
|
||||
if (messageID.has_error())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user