mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
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:
parent
1b3aa343a3
commit
bd3d2ed82a
3 changed files with 32 additions and 0 deletions
|
@ -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)
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -72,6 +72,7 @@ static const QStringList TWITCH_DEFAULT_COMMANDS{
|
|||
"unraid",
|
||||
"delete",
|
||||
"announce",
|
||||
"requests",
|
||||
};
|
||||
|
||||
static const QStringList TWITCH_WHISPER_COMMANDS{"/w", ".w"};
|
||||
|
|
Loading…
Reference in a new issue