feat(eventsub): implement suspicious user message (#6007)
This commit is contained in:
+11
-15
@@ -2,35 +2,31 @@
|
||||
|
||||
#include "twitch-eventsub-ws/payloads/structured-message.hpp"
|
||||
#include "twitch-eventsub-ws/payloads/subscription.hpp"
|
||||
#include "twitch-eventsub-ws/payloads/suspicious-users.hpp"
|
||||
|
||||
#include <boost/json.hpp>
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace chatterino::eventsub::lib::payload::channel_suspicious_user_message::
|
||||
v1 {
|
||||
|
||||
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;
|
||||
std::string userLogin;
|
||||
std::string userName;
|
||||
String userID;
|
||||
String userLogin;
|
||||
String userName;
|
||||
|
||||
// "none", "active_monitoring", "restricted"
|
||||
std::string lowTrustStatus;
|
||||
suspicious_users::Status lowTrustStatus;
|
||||
|
||||
std::vector<std::string> sharedBanChannelIds;
|
||||
std::vector<String> sharedBanChannelIds;
|
||||
|
||||
// "manual", "ban_evader_detector", or "shared_channel_ban"
|
||||
std::vector<std::string> types;
|
||||
std::vector<suspicious_users::Type> types;
|
||||
|
||||
// "unknown", "possible", "likely"
|
||||
std::string banEvasionEvaluation;
|
||||
suspicious_users::BanEvasionEvaluation banEvasionEvaluation;
|
||||
// this event also has the ID in this message (hopefully we don't need it)
|
||||
chat::Message message;
|
||||
};
|
||||
|
||||
+12
-13
@@ -1,32 +1,31 @@
|
||||
#pragma once
|
||||
|
||||
#include "twitch-eventsub-ws/payloads/subscription.hpp"
|
||||
#include "twitch-eventsub-ws/payloads/suspicious-users.hpp"
|
||||
#include "twitch-eventsub-ws/string.hpp"
|
||||
|
||||
#include <boost/json.hpp>
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace chatterino::eventsub::lib::payload::channel_suspicious_user_update::
|
||||
v1 {
|
||||
|
||||
struct Event {
|
||||
// Broadcaster of the channel
|
||||
std::string broadcasterUserID;
|
||||
std::string broadcasterUserLogin;
|
||||
std::string broadcasterUserName;
|
||||
String broadcasterUserID;
|
||||
String broadcasterUserLogin;
|
||||
String broadcasterUserName;
|
||||
|
||||
// Affected user
|
||||
std::string userID;
|
||||
std::string userLogin;
|
||||
std::string userName;
|
||||
String userID;
|
||||
String userLogin;
|
||||
String userName;
|
||||
|
||||
// Moderator who updated the user
|
||||
std::string moderatorUserID;
|
||||
std::string moderatorUserLogin;
|
||||
std::string moderatorUserName;
|
||||
String moderatorUserID;
|
||||
String moderatorUserLogin;
|
||||
String moderatorUserName;
|
||||
|
||||
// "none", "active_monitoring", or "restricted"
|
||||
std::string lowTrustStatus;
|
||||
suspicious_users::Status lowTrustStatus;
|
||||
};
|
||||
|
||||
struct Payload {
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace chatterino::eventsub::lib::suspicious_users {
|
||||
|
||||
/// default=None
|
||||
enum class Status : std::uint8_t {
|
||||
None,
|
||||
ActiveMonitoring,
|
||||
Restricted,
|
||||
};
|
||||
|
||||
/// default=Unknown
|
||||
enum class Type : std::uint8_t {
|
||||
Unknown,
|
||||
Manual,
|
||||
BanEvaderDetector,
|
||||
SharedChannelBan
|
||||
};
|
||||
|
||||
/// default=Unknown
|
||||
enum class BanEvasionEvaluation : std::uint8_t {
|
||||
Unknown,
|
||||
Possible,
|
||||
Likely,
|
||||
};
|
||||
|
||||
#include "twitch-eventsub-ws/payloads/suspicious-users.inc"
|
||||
|
||||
} // namespace chatterino::eventsub::lib::suspicious_users
|
||||
@@ -0,0 +1,9 @@
|
||||
boost::json::result_for<Status, boost::json::value>::type tag_invoke(
|
||||
boost::json::try_value_to_tag<Status>, const boost::json::value &jvRoot);
|
||||
|
||||
boost::json::result_for<Type, boost::json::value>::type tag_invoke(
|
||||
boost::json::try_value_to_tag<Type>, const boost::json::value &jvRoot);
|
||||
|
||||
boost::json::result_for<BanEvasionEvaluation, boost::json::value>::type
|
||||
tag_invoke(boost::json::try_value_to_tag<BanEvasionEvaluation>,
|
||||
const boost::json::value &jvRoot);
|
||||
Reference in New Issue
Block a user