#pragma once #include "common/Singleton.hpp" #include #include #include #include "common/SignalVector.hpp" #include "controllers/commands/Command.hpp" namespace chatterino { class Settings; class Paths; class Channel; class CommandModel; class CommandController final : public Singleton { public: CommandController(); QString execCommand(const QString &text, std::shared_ptr channel, bool dryRun); QStringList getDefaultTwitchCommandList(); virtual void initialize(Settings &settings, Paths &paths) override; virtual void save() override; CommandModel *createModel(QObject *parent); UnsortedSignalVector items; private: void load(Paths &paths); QMap commandsMap_; std::mutex mutex_; QString filePath_; QString execCustomCommand(const QStringList &words, const Command &command); }; } // namespace chatterino