diff options
| author | ilotterytea <iltsu@alright.party> | 2024-12-07 17:24:25 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2024-12-07 17:24:25 +0500 |
| commit | 52fd4ea8bad5cd7d3940a41df4f8f54b4e72beae (patch) | |
| tree | 28f13892e7da8ec023f4b4d1113bef88795724ca /bot/src/commands/command.hpp | |
| parent | e604d12282b8fa9f9023bb79161b36c9a8b0be55 (diff) | |
feat: a special class for command responses
Diffstat (limited to 'bot/src/commands/command.hpp')
| -rw-r--r-- | bot/src/commands/command.hpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/bot/src/commands/command.hpp b/bot/src/commands/command.hpp index 40ec114..793446e 100644 --- a/bot/src/commands/command.hpp +++ b/bot/src/commands/command.hpp @@ -3,11 +3,11 @@ #include <memory> #include <optional> #include <string> -#include <variant> #include <vector> #include "../bundle.hpp" #include "request.hpp" +#include "response.hpp" namespace bot { namespace command { @@ -24,8 +24,8 @@ namespace bot { class Command { public: virtual std::string get_name() const = 0; - virtual std::variant<std::vector<std::string>, std::string> run( - const InstanceBundle &bundle, const Request &request) const = 0; + virtual Response run(const InstanceBundle &bundle, + const Request &request) const = 0; virtual schemas::PermissionLevel get_permission_level() const { return schemas::PermissionLevel::USER; } @@ -41,8 +41,8 @@ namespace bot { ~CommandLoader() = default; void add_command(std::unique_ptr<Command> cmd); - std::optional<std::variant<std::vector<std::string>, std::string>> run( - const InstanceBundle &bundle, const Request &msg) const; + std::optional<Response> run(const InstanceBundle &bundle, + const Request &msg) const; const std::vector<std::unique_ptr<Command>> &get_commands() const { return this->commands; |
