From 99045e42da9a38dd1c361f0513073b62cd2a3ad1 Mon Sep 17 00:00:00 2001 From: apa420 Date: Mon, 3 Jun 2019 15:56:54 +0000 Subject: [PATCH] Adds support for /user --- .../commands/CommandController.cpp | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/controllers/commands/CommandController.cpp b/src/controllers/commands/CommandController.cpp index 69a6195f..ae46f6e2 100644 --- a/src/controllers/commands/CommandController.cpp +++ b/src/controllers/commands/CommandController.cpp @@ -29,7 +29,7 @@ "/unban", "/timeout", "/untimeout", "/slow", "/slowoff", \ "/r9kbeta", "/r9kbetaoff", "/emoteonly", "/emoteonlyoff", \ "/clear", "/subscribers", "/subscribersoff", "/followers", \ - "/followersoff" \ + "/followersoff", "/user" \ } namespace { @@ -461,6 +461,27 @@ QString CommandController::execCommand(const QString &textNoEmoji, logs->show(); return ""; } + else if (commandName == "/user") + { + if (words.size() < 2) + { + channel->addMessage( + makeSystemMessage("Usage /user [user] (channel)")); + return ""; + } + QString channelName = channel->getName(); + if (words.size() > 2) + { + channelName = words[2]; + if (channelName[0] == '#') + { + channelName.remove(0, 1); + } + } + QDesktopServices::openUrl("https://www.twitch.tv/popout/" + + channelName + "/viewercard/" + words[1]); + return ""; + } } {