Added the ability to use custom config files in the main.cpp

This commit is contained in:
Mathias Wagner 2023-10-29 14:39:53 +01:00
parent 98a9b068a4
commit 7f0c7828fb
Signed by: Mathias
GPG Key ID: B8DC354B0A1F5B44

View File

@ -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);