diff --git a/src/controllers/commands/commandcontroller.cpp b/src/controllers/commands/commandcontroller.cpp index 6815d8fda..14d9c1063 100644 --- a/src/controllers/commands/commandcontroller.cpp +++ b/src/controllers/commands/commandcontroller.cpp @@ -15,6 +15,14 @@ #include #include +#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; namespace chatterino { @@ -274,6 +282,14 @@ QString CommandController::execCustomCommand(const QStringList &words, const Com return result.replace("{{", "{"); } +QStringList CommandController::getDefaultTwitchCommandList() +{ + QStringList l = TWITCH_DEFAULT_COMMANDS; + l += "/uptime"; + + return l; +} + } // namespace commands } // namespace controllers } // namespace chatterino diff --git a/src/controllers/commands/commandcontroller.hpp b/src/controllers/commands/commandcontroller.hpp index cf2a06ac1..2fe8ba3b0 100644 --- a/src/controllers/commands/commandcontroller.hpp +++ b/src/controllers/commands/commandcontroller.hpp @@ -21,6 +21,7 @@ public: CommandController(); QString execCommand(const QString &text, std::shared_ptr channel, bool dryRun); + QStringList getDefaultTwitchCommandList(); void load(); void save(); diff --git a/src/util/completionmodel.cpp b/src/util/completionmodel.cpp index 0d2169c2c..372290c3e 100644 --- a/src/util/completionmodel.cpp +++ b/src/util/completionmodel.cpp @@ -69,6 +69,10 @@ void CompletionModel::refresh() this->addString(command.name, TaggedString::Command); } + for (auto &command : app->commands->getDefaultTwitchCommandList()) { + this->addString(command, TaggedString::Command); + } + // Channel-specific: Usernames // fourtf: only works with twitch chat // auto c = singletons::ChannelManager::getInstance().getTwitchChannel(this->channelName);