Added a security check to the main.cpp

This commit is contained in:
Mathias Wagner 2023-11-08 12:22:21 +01:00
parent 8e2eba392f
commit 71548d2ff4

View File

@ -15,9 +15,15 @@ using namespace sql;
int main(int argc, char **argv) { int main(int argc, char **argv) {
json configuration = config::read_config(argc < 2 ? CONFIG_PATH : argv[1]); json configuration = config::read_config(argc < 2 ? CONFIG_PATH : argv[1]);
Connection *con = util::createConnection(configuration["database"]); Connection *con = util::createConnection(configuration["database"]);
if (con == nullptr) {
std::cout << "Could not connect too database";
return 1;
}
std::cout << "Using database " << con->getSchema() << std::endl;
cluster bot(configuration["token"], dpp::i_default_intents | dpp::i_message_content); cluster bot(configuration["token"], dpp::i_default_intents | dpp::i_message_content);
bot.on_log(dpp::utility::cout_logger()); bot.on_log(dpp::utility::cout_logger());