mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
feat: add /lowtrust command (#4542)
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
parent
782684e41a
commit
c44e7295da
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue