diff options
| author | ilotterytea <iltsu@alright.party> | 2025-07-03 18:05:11 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-07-03 18:05:47 +0500 |
| commit | e23ccfb00c8fa39926b32e94be6bc379e70ba11d (patch) | |
| tree | ad4758e8a1b947782186f11f1739dde1aca9ca23 /bot/src/commands/request.hpp | |
| parent | 1e8f182b083679b06d8e30fe52b1ed1130a19287 (diff) | |
feat: separated requester from request
Diffstat (limited to 'bot/src/commands/request.hpp')
| -rw-r--r-- | bot/src/commands/request.hpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/bot/src/commands/request.hpp b/bot/src/commands/request.hpp index 9822fc8..00d8afc 100644 --- a/bot/src/commands/request.hpp +++ b/bot/src/commands/request.hpp @@ -18,16 +18,20 @@ namespace bot::command { #include "database.hpp" namespace bot::command { + struct Requester { + schemas::Channel channel; + schemas::ChannelPreferences channel_preferences; + schemas::User user; + schemas::UserRights user_rights; + }; + 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; - schemas::Channel channel; - schemas::ChannelPreferences channel_preferences; - schemas::User user; - schemas::UserRights user_rights; + const Requester requester; sol::table as_lua_table(std::shared_ptr<sol::state> luaState) const; }; @@ -35,5 +39,9 @@ namespace bot::command { std::optional<Request> generate_request( const command::CommandLoader &command_loader, const irc::Message<irc::MessageType::Privmsg> &irc_message, + const Requester &requester, std::unique_ptr<db::BaseDatabase> &conn); + + std::optional<Requester> get_requester( + const irc::Message<irc::MessageType::Privmsg> &irc_message, std::unique_ptr<db::BaseDatabase> &conn); } |
