From 7f0c7828fb25596d6f213a076cff677d772d758c Mon Sep 17 00:00:00 2001 From: Mathias Wagner Date: Sun, 29 Oct 2023 14:39:53 +0100 Subject: [PATCH] Added the ability to use custom config files in the main.cpp --- src/main.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 93b55fb..1afc531 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2,12 +2,14 @@ #include "listeners/ready.h" #include "api/config.h" +#define CONFIG_PATH "config.json" + using json = nlohmann::json; using namespace dpp; -int main() { - json configuration = config::read_config(); +int main(int argc, char **argv) { + json configuration = config::read_config(argc < 2 ? CONFIG_PATH : argv[1]); cluster bot(configuration["token"], dpp::i_default_intents | dpp::i_message_content);