Added the connection to main.cpp

This commit is contained in:
Mathias Wagner 2023-10-29 22:30:28 +01:00
parent 87d73e1dbb
commit 8f3e599e6d
Signed by: Mathias
GPG Key ID: B8DC354B0A1F5B44

View File

@ -2,16 +2,21 @@
#include "listeners/ready.h"
#include "listeners/slash.h"
#include "api/config.h"
#include "api/util.h"
#include <mariadb/conncpp.hpp>
#define CONFIG_PATH "config.json"
using json = nlohmann::json;
using namespace dpp;
using namespace sql;
int main(int argc, char **argv) {
json configuration = config::read_config(argc < 2 ? CONFIG_PATH : argv[1]);
Connection *con = util::createConnection(configuration["database"]);
cluster bot(configuration["token"], dpp::i_default_intents | dpp::i_message_content);
bot.on_slashcommand([&bot](const slashcommand_t &event) { slash::execute(bot, event); });