Initial backend test for user-based data/customizations (#4144)

Right now only support for colors and no real UX, idea is to test it & allow the idea to grow while figuring out the UX
This commit is contained in:
pajlada
2022-11-13 18:21:21 +01:00
committed by GitHub
parent a9d3c00369
commit 1eabda8668
13 changed files with 372 additions and 1 deletions
@@ -8,6 +8,7 @@
#include "controllers/commands/Command.hpp"
#include "controllers/commands/CommandModel.hpp"
#include "controllers/commands/builtin/twitch/ChatSettings.hpp"
#include "controllers/userdata/UserDataController.hpp"
#include "messages/Message.hpp"
#include "messages/MessageBuilder.hpp"
#include "messages/MessageElement.hpp"
@@ -3037,6 +3038,22 @@ void CommandController::initialize(Settings &, Paths &paths)
return "";
});
this->registerCommand("/unstable-set-user-color", [](const auto &ctx) {
auto userID = ctx.words.at(1);
if (ctx.words.size() < 2)
{
ctx.channel->addMessage(
makeSystemMessage(QString("Usage: %1 <TwitchUserID> [color]")
.arg(ctx.words.at(0))));
}
auto color = ctx.words.value(2);
getIApp()->getUserData()->setUserColor(userID, color);
return "";
});
}
void CommandController::save()