Implemented AutoMod and write pubsub automod messages TODO: implement that the AutoMod message gets deleted if dealt with \nFixes #887

This commit is contained in:
apa420
2019-01-21 18:33:57 +01:00
parent cd5c373e01
commit 1434225603
6 changed files with 190 additions and 39 deletions
+15
View File
@@ -251,6 +251,21 @@ void Application::initPubsub()
});
});
this->twitch.pubsub->signals_.moderation.automodUserMessage.connect(
[&](const auto &action) {
auto chan =
this->twitch.server->getChannelOrEmptyByID(action.roomID);
if (chan->isEmpty())
{
return;
}
auto msg = MessageBuilder(action).release();
postToThread([chan, msg] { chan->addMessage(msg); });
});
this->twitch.pubsub->start();
auto RequestModerationActions = [=]() {