blob: 9822fc8ac9dfecbc67f88e1e7f48659689382b38 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
#pragma once
#include <memory>
#include <optional>
#include <sol/state.hpp>
#include <sol/table.hpp>
#include <string>
#include "../irc/message.hpp"
#include "../schemas/channel.hpp"
#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;
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;
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);
}
|