summaryrefslogtreecommitdiff
path: root/bot/src/commands/request.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'bot/src/commands/request.hpp')
-rw-r--r--bot/src/commands/request.hpp16
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);
}