From 20911c0cfbe608cc6188cfa27e4f953632a3ef29 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sun, 21 Apr 2024 18:00:16 +0500 Subject: feat: handler for chat messages --- src/main.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index dffe4d0..7ba4c2e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,9 +1,12 @@ #include #include +#include "bundle.hpp" #include "commands/command.hpp" #include "config.hpp" +#include "handlers.hpp" #include "irc/client.hpp" +#include "irc/message.hpp" #include "localization/localization.hpp" int main(int argc, char *argv[]) { @@ -28,6 +31,14 @@ int main(int argc, char *argv[]) { bot::loc::Localization localization("localization"); client.join(cfg.bot_username); + + client.on( + [&client, &command_loader, &localization]( + const bot::irc::Message &message) { + bot::InstanceBundle bundle{client, localization}; + bot::handlers::handle_private_message(bundle, command_loader, message); + }); + client.run(); return 0; -- cgit v1.2.3