feat(eventsub): implement automod message hold (#6005)

This commit is contained in:
nerix
2025-03-01 08:32:50 +01:00
committed by GitHub
parent 95b97f42e6
commit 8f1f07d672
17 changed files with 1769 additions and 19 deletions
+30 -1
View File
@@ -1,5 +1,6 @@
#include "common/Literals.hpp"
#include "controllers/accounts/AccountController.hpp"
#include "controllers/highlights/HighlightController.hpp"
#include "lib/Snapshot.hpp"
#include "messages/Message.hpp"
#include "mocks/BaseApplication.hpp"
@@ -62,12 +63,34 @@ const std::map<QString, std::string_view, QCompareCaseInsensitive>
"cost": 0
})",
},
{
"automod-message-hold",
R"({
"id": "a3122e32-6498-4847-8675-109b9b94f29c",
"status": "enabled",
"type": "automod.message.hold",
"version": "2",
"condition": {
"broadcaster_user_id": "489584266",
"moderator_user_id": "489584266"
},
"transport": {
"method":"websocket",
"session_id":"AgoQ59RRLw0mS6S000QtK8f54BIGY2VsbC1j"
},
"created_at": "2025-02-28T15:55:37.85489173Z",
"cost": 0
})",
},
};
class MockApplication : public mock::BaseApplication
{
public:
MockApplication() = default;
MockApplication()
: highlights(this->settings, &this->accounts)
{
}
ILogging *getChatLogger() override
{
@@ -84,9 +107,15 @@ public:
return &this->accounts;
}
HighlightController *getHighlights() override
{
return &this->highlights;
}
mock::EmptyLogging logging;
mock::MockTwitchIrcServer twitch;
AccountController accounts;
HighlightController highlights;
};
std::shared_ptr<TwitchChannel> makeMockTwitchChannel(const QString &name)