summaryrefslogtreecommitdiff
path: root/bot/src/modules/ping.hpp
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/modules/ping.hpp
parente604d12282b8fa9f9023bb79161b36c9a8b0be55 (diff)
feat: a special class for command responses
Diffstat (limited to 'bot/src/modules/ping.hpp')
-rw-r--r--bot/src/modules/ping.hpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/bot/src/modules/ping.hpp b/bot/src/modules/ping.hpp
index 836917d..cc982f6 100644
--- a/bot/src/modules/ping.hpp
+++ b/bot/src/modules/ping.hpp
@@ -6,7 +6,6 @@
#include <chrono>
#include <string>
-#include <variant>
#include <vector>
#include "../bundle.hpp"
@@ -18,9 +17,8 @@ namespace bot {
class Ping : public command::Command {
std::string get_name() const override { return "ping"; }
- std::variant<std::vector<std::string>, std::string> run(
- const InstanceBundle &bundle,
- const command::Request &request) const override {
+ command::Response run(const InstanceBundle &bundle,
+ const command::Request &request) const override {
auto now = std::chrono::steady_clock::now();
auto duration = now - START_TIME;
auto seconds =
@@ -48,11 +46,12 @@ namespace bot {
cpp_info.append(" ยท ");
}
- return bundle.localization
- .get_formatted_line(
- request, loc::LineId::PingResponse,
- {cpp_info, uptime, std::to_string(used_memory)})
- .value();
+ return command::Response(
+ bundle.localization
+ .get_formatted_line(
+ request, loc::LineId::PingResponse,
+ {cpp_info, uptime, std::to_string(used_memory)})
+ .value());
}
};
}