From e23ccfb00c8fa39926b32e94be6bc379e70ba11d Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Thu, 3 Jul 2025 18:05:11 +0500 Subject: feat: separated requester from request --- bot/src/commands/request.hpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'bot/src/commands/request.hpp') 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,22 +18,30 @@ 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 subcommand_id; std::optional message; const irc::Message &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 luaState) const; }; std::optional generate_request( const command::CommandLoader &command_loader, + const irc::Message &irc_message, + const Requester &requester, std::unique_ptr &conn); + + std::optional get_requester( const irc::Message &irc_message, std::unique_ptr &conn); } -- cgit v1.2.3