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.hpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/bot/src/commands/request.hpp b/bot/src/commands/request.hpp
index b6ed534..9822fc8 100644
--- a/bot/src/commands/request.hpp
+++ b/bot/src/commands/request.hpp
@@ -2,7 +2,6 @@
#include <memory>
#include <optional>
-#include <pqxx/pqxx>
#include <sol/state.hpp>
#include <sol/table.hpp>
#include <string>
@@ -12,6 +11,13 @@
#include "../schemas/user.hpp"
namespace bot::command {
+ struct Request;
+}
+
+#include "commands/command.hpp"
+#include "database.hpp"
+
+namespace bot::command {
struct Request {
std::string command_id;
std::optional<std::string> subcommand_id;
@@ -23,8 +29,11 @@ namespace bot::command {
schemas::User user;
schemas::UserRights user_rights;
- pqxx::connection &conn;
-
sol::table as_lua_table(std::shared_ptr<sol::state> luaState) const;
};
+
+ std::optional<Request> generate_request(
+ const command::CommandLoader &command_loader,
+ const irc::Message<irc::MessageType::Privmsg> &irc_message,
+ std::unique_ptr<db::BaseDatabase> &conn);
}