added completion for default twitch commands
This commit is contained in:
@@ -15,6 +15,14 @@
|
|||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
|
|
||||||
|
#define TWITCH_DEFAULT_COMMANDS \
|
||||||
|
{ \
|
||||||
|
"/help", "/w", "/me", "/disconnect", "/mods", "/color", "/ban", "/unban", "/timeout", \
|
||||||
|
"/untimeout", "/slow", "/slowoff", "/r9kbeta", "/r9kbetaoff", "/emoteonly", \
|
||||||
|
"/emoteonlyoff", "/clear", "/subscribers", "/subscribersoff", "/followers", \
|
||||||
|
"/followersoff" \
|
||||||
|
}
|
||||||
|
|
||||||
using namespace chatterino::providers::twitch;
|
using namespace chatterino::providers::twitch;
|
||||||
|
|
||||||
namespace chatterino {
|
namespace chatterino {
|
||||||
@@ -274,6 +282,14 @@ QString CommandController::execCustomCommand(const QStringList &words, const Com
|
|||||||
return result.replace("{{", "{");
|
return result.replace("{{", "{");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QStringList CommandController::getDefaultTwitchCommandList()
|
||||||
|
{
|
||||||
|
QStringList l = TWITCH_DEFAULT_COMMANDS;
|
||||||
|
l += "/uptime";
|
||||||
|
|
||||||
|
return l;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace commands
|
} // namespace commands
|
||||||
} // namespace controllers
|
} // namespace controllers
|
||||||
} // namespace chatterino
|
} // namespace chatterino
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ public:
|
|||||||
CommandController();
|
CommandController();
|
||||||
|
|
||||||
QString execCommand(const QString &text, std::shared_ptr<Channel> channel, bool dryRun);
|
QString execCommand(const QString &text, std::shared_ptr<Channel> channel, bool dryRun);
|
||||||
|
QStringList getDefaultTwitchCommandList();
|
||||||
|
|
||||||
void load();
|
void load();
|
||||||
void save();
|
void save();
|
||||||
|
|||||||
@@ -69,6 +69,10 @@ void CompletionModel::refresh()
|
|||||||
this->addString(command.name, TaggedString::Command);
|
this->addString(command.name, TaggedString::Command);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (auto &command : app->commands->getDefaultTwitchCommandList()) {
|
||||||
|
this->addString(command, TaggedString::Command);
|
||||||
|
}
|
||||||
|
|
||||||
// Channel-specific: Usernames
|
// Channel-specific: Usernames
|
||||||
// fourtf: only works with twitch chat
|
// fourtf: only works with twitch chat
|
||||||
// auto c = singletons::ChannelManager::getInstance().getTwitchChannel(this->channelName);
|
// auto c = singletons::ChannelManager::getInstance().getTwitchChannel(this->channelName);
|
||||||
|
|||||||
Reference in New Issue
Block a user