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:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user