diff options
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp index c7e8e2f..67cf3a5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -56,10 +56,18 @@ int main(int argc, char *argv[]) { conn.close(); client.on<bot::irc::MessageType::Privmsg>( - [&client, &command_loader, &localization]( - const bot::irc::Message<bot::irc::MessageType::Privmsg> &message) { + [&client, &command_loader, &localization, + &cfg](const bot::irc::Message<bot::irc::MessageType::Privmsg> &message) { bot::InstanceBundle bundle{client, localization}; - bot::handlers::handle_private_message(bundle, command_loader, message); + + pqxx::connection conn(GET_DATABASE_CONNECTION_URL(cfg)); + pqxx::work work(conn); + + bot::handlers::handle_private_message(bundle, command_loader, message, + work); + + work.commit(); + conn.close(); }); client.run(); |
