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.cpp | |
| parent | e604d12282b8fa9f9023bb79161b36c9a8b0be55 (diff) | |
feat: a special class for command responses
Diffstat (limited to 'bot/src/commands/command.cpp')
| -rw-r--r-- | bot/src/commands/command.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bot/src/commands/command.cpp b/bot/src/commands/command.cpp index b656254..8d75999 100644 --- a/bot/src/commands/command.cpp +++ b/bot/src/commands/command.cpp @@ -20,6 +20,7 @@ #include "../modules/timer.hpp" #include "../utils/chrono.hpp" #include "request.hpp" +#include "response.hpp" namespace bot { namespace command { @@ -39,9 +40,8 @@ namespace bot { this->commands.push_back(std::move(command)); } - std::optional<std::variant<std::vector<std::string>, std::string>> - CommandLoader::run(const InstanceBundle &bundle, - const Request &request) const { + std::optional<Response> CommandLoader::run(const InstanceBundle &bundle, + const Request &request) const { auto command = std::find_if( this->commands.begin(), this->commands.end(), [&](const auto &x) { return x->get_name() == request.command_id; }); |
