Integrated the global listener to the main.cpp

This commit is contained in:
Mathias Wagner 2023-11-04 12:23:41 +01:00
parent 86e980267b
commit 9526336719
Signed by: Mathias
GPG Key ID: B8DC354B0A1F5B44

View File

@ -1,6 +1,7 @@
#include <dpp/dpp.h>
#include "listeners/ready.h"
#include "listeners/slash.h"
#include "listeners/global.h"
#include "api/config.h"
#include "api/util.h"
#include <mariadb/conncpp.hpp>
@ -19,7 +20,9 @@ int main(int argc, char **argv) {
cluster bot(configuration["token"], dpp::i_default_intents | dpp::i_message_content);
bot.on_slashcommand([&bot](const slashcommand_t &event) { slash::execute(bot, event); });
bot.on_slashcommand([&bot, &con](const slashcommand_t &event) { slash::execute(*con, bot, event); });
bot.on_message_create([&bot, &con](const message_create_t &event) { global::execute(*con, bot, event); });
bot.on_ready([&bot](const ready_t &event) { ready::execute(bot, event); });