diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fe5982c8..3ed1ebea8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ - Minor: Fixed tag parsing for consecutive escaped characters. (#3711) - Minor: Prevent user from entering incorrect characters in Live Notifications channels list. (#3715, #3730) - Minor: Fixed automod caught message notice appearing twice for mods. (#3717) +- Minor: Added `/requests` command. Usage: `/requests [channel]`. Opens the channel points requests queue for the provided channel or the current channel if no input is provided. (#3746) - Bugfix: Fixed live notifications for usernames containing uppercase characters. (#3646) - Bugfix: Fixed live notifications not getting updated for closed streams going offline. (#3678) - Bugfix: Fixed certain settings dialogs appearing behind the main window, when `Always on top` was used. (#3679) diff --git a/src/controllers/commands/CommandController.cpp b/src/controllers/commands/CommandController.cpp index e4fe0f20e..99525f6f0 100644 --- a/src/controllers/commands/CommandController.cpp +++ b/src/controllers/commands/CommandController.cpp @@ -548,6 +548,36 @@ void CommandController::initialize(Settings &, Paths &paths) return ""; }); + this->registerCommand("/requests", [](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: /requests [channel]. You can also use the command " + "without arguments in any Twitch channel to open its " + "channel points requests queue. Only the broadcaster and " + "moderators have permission to view the queue.")); + return ""; + } + } + + stripChannelName(target); + QDesktopServices::openUrl( + QUrl(QString("https://www.twitch.tv/popout/%1/reward-queue") + .arg(target))); + + return ""; + }); + this->registerCommand( "/chatters", [](const auto & /*words*/, auto channel) { auto twitchChannel = dynamic_cast(channel.get()); diff --git a/src/providers/twitch/TwitchCommon.hpp b/src/providers/twitch/TwitchCommon.hpp index 1979bd6e6..3882ee588 100644 --- a/src/providers/twitch/TwitchCommon.hpp +++ b/src/providers/twitch/TwitchCommon.hpp @@ -72,6 +72,7 @@ static const QStringList TWITCH_DEFAULT_COMMANDS{ "unraid", "delete", "announce", + "requests", }; static const QStringList TWITCH_WHISPER_COMMANDS{"/w", ".w"};