Added /requests command. Usage: /requests [channel]. (#3746)

Opens the channel points requests queue for the provided channel or the current channel if no input is provided.

Co-authored-by: Mm2PL <mm2pl+gh@kotmisia.pl>
This commit is contained in:
badoge 2022-05-22 15:53:45 +04:00 committed by GitHub
parent 1b3aa343a3
commit bd3d2ed82a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 0 deletions

View file

@ -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)

View file

@ -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<TwitchChannel *>(channel.get());

View file

@ -72,6 +72,7 @@ static const QStringList TWITCH_DEFAULT_COMMANDS{
"unraid",
"delete",
"announce",
"requests",
};
static const QStringList TWITCH_WHISPER_COMMANDS{"/w", ".w"};