From 1d7edf3ee300c585ef6d679be33272f0547f06a2 Mon Sep 17 00:00:00 2001 From: Brett Date: Wed, 1 May 2024 20:34:27 -0400 Subject: [PATCH] silly boi --- src/main.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 57ca10e..a184d29 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -13,6 +13,7 @@ #include #include #include +#include namespace sql = sqlite_orm; using namespace db; @@ -469,10 +470,20 @@ int main(int argc, const char** argv) parser.addArgument(blt::arg_builder("-p", "--path").setAction(blt::arg_action_t::STORE).setHelp("Path to store the archive data").build()); auto args = parser.parse_args(argc, argv); - path = args.get("path"); + if (args.contains("path")) + path = args.get("path"); + else + path = std::getenv("PATH"); + + std::string token; + if (args.contains("token")) + token = args.get("token"); + else + token = std::getenv("TOKEN"); + std::filesystem::create_directories(path); - dpp::cluster bot(args.get("token"), dpp::i_default_intents | dpp::i_message_content | dpp::i_all_intents | dpp::i_guild_members); + dpp::cluster bot(token, dpp::i_default_intents | dpp::i_message_content | dpp::i_all_intents | dpp::i_guild_members); bot.start_timer([](const auto&) { for (auto& db : databases)