diff --git a/CHANGELOG.md b/CHANGELOG.md index b63d780e..fd24b974 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - Minor: Added better filter validation and error messages. (#4364) - Minor: Updated the look of the Black Theme to be more in line with the other themes. (#4523) - Minor: Reply context now censors blocked users. (#4502) +- Minor: Added `/lowtrust` command to open the suspicious user activity feed in browser. (#4542) - Bugfix: Fixed an issue where animated emotes would render on top of zero-width emotes. (#4314) - Bugfix: Fixed an issue where it was difficult to hover a zero-width emote. (#4314) - Bugfix: Fixed an issue where context-menu items for zero-width emotes displayed the wrong provider. (#4460) diff --git a/src/controllers/commands/CommandController.cpp b/src/controllers/commands/CommandController.cpp index ae1ce909..01abcc26 100644 --- a/src/controllers/commands/CommandController.cpp +++ b/src/controllers/commands/CommandController.cpp @@ -952,6 +952,36 @@ void CommandController::initialize(Settings &, Paths &paths) return ""; }); + this->registerCommand("/lowtrust", [](const QStringList &words, + ChannelPtr channel) { + QString target(words.value(1)); + + if (target.isEmpty()) + { + if (channel->getType() == Channel::Type::Twitch && + !channel->isEmpty()) + { + target = channel->getName(); + } + else + { + channel->addMessage(makeSystemMessage( + "Usage: /lowtrust [channel]. You can also use the command " + "without arguments in any Twitch channel to open its " + "suspicious user activity feed. Only the broadcaster and " + "moderators have permission to view this feed.")); + return ""; + } + } + + stripChannelName(target); + QDesktopServices::openUrl(QUrl( + QString("https://www.twitch.tv/popout/moderator/%1/low-trust-users") + .arg(target))); + + return ""; + }); + auto formatChattersError = [](HelixGetChattersError error, QString message) { using Error = HelixGetChattersError;