diff options
| author | ilotterytea <iltsu@alright.party> | 2024-04-21 17:20:38 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2024-04-21 17:20:38 +0500 |
| commit | 8c391504d160909753e6c6ee3186e0166b44c475 (patch) | |
| tree | 43a95cf37ef9075d32a41ae8b7d924df68d845e9 /src/commands/request.hpp | |
| parent | 6572077c73406cf6c353395aad13d493929a1596 (diff) | |
feat: use Request instead of Message + util for creating requests
Diffstat (limited to 'src/commands/request.hpp')
| -rw-r--r-- | src/commands/request.hpp | 42 |
1 files changed, 7 insertions, 35 deletions
diff --git a/src/commands/request.hpp b/src/commands/request.hpp index 71f2f04..9742cbc 100644 --- a/src/commands/request.hpp +++ b/src/commands/request.hpp @@ -4,40 +4,12 @@ #include <string> #include "../irc/message.hpp" -#include "command.hpp" - -namespace bot { - namespace command { - class Request { - public: - Request(const command::CommandLoader &command_loader, - const irc::Message<irc::MessageType::Privmsg> &irc_message) - : irc_message(irc_message), command_loader(command_loader){}; - ~Request() = default; - - bool fill_request(); - - const std::string &get_command_id() const { return this->command_id; }; - const std::optional<std::string> &get_subcommand_id() const { - return this->subcommand_id; - }; - const std::optional<std::string> &get_message() const { - return this->message; - }; - - const irc::Message<irc::MessageType::Privmsg> &get_irc_message() const { - return this->irc_message; - }; - - private: - std::string command_id; - std::optional<std::string> subcommand_id; - std::optional<std::string> message; - - const irc::Message<irc::MessageType::Privmsg> &irc_message; - const command::CommandLoader &command_loader; - }; - - } +namespace bot::command { + struct Request { + std::string command_id; + std::optional<std::string> subcommand_id; + std::optional<std::string> message; + const irc::Message<irc::MessageType::Privmsg> &irc_message; + }; } |
