summaryrefslogtreecommitdiff
path: root/bot/src/commands/command.cpp
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2024-12-07 17:24:25 +0500
committerilotterytea <iltsu@alright.party>2024-12-07 17:24:25 +0500
commit52fd4ea8bad5cd7d3940a41df4f8f54b4e72beae (patch)
tree28f13892e7da8ec023f4b4d1113bef88795724ca /bot/src/commands/command.cpp
parente604d12282b8fa9f9023bb79161b36c9a8b0be55 (diff)
feat: a special class for command responses
Diffstat (limited to 'bot/src/commands/command.cpp')
-rw-r--r--bot/src/commands/command.cpp6
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; });