From c251ef0c343ba5c167612fbb6d47a54492204d27 Mon Sep 17 00:00:00 2001 From: Brett Date: Thu, 22 Feb 2024 16:22:48 -0500 Subject: [PATCH] ginore --- src/main.cpp | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 555cf0e..e0f0bb5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -7,26 +7,41 @@ int main(int argc, const char** argv) { blt::arg_parse parser; - parser.addArgument(blt::arg_builder("--token").setRequired().build()); + parser.addArgument(blt::arg_builder("-t", "--token").setDefault("uWU").setAction(blt::arg_action_t::STORE).setHelp("The discord bot token").setRequired().build()); + +// for (int i = 0; i < argc; i++) +// BLT_TRACE(argv[i]); auto args = parser.parse_args(argc, argv); - dpp::cluster bot(args.get("--token")); + BLT_TRACE(args.get("--token")); + BLT_TRACE(argv[argc-1]); + dpp::cluster bot(argv[argc-1]); bot.on_slashcommand([](auto event) { - if (event.command.get_command_name() == "ping") { + if (event.command.get_command_name() == "ping") + { event.reply("Pong!"); } }); bot.on_ready([&bot](auto event) { - if (dpp::run_once()) { + if (dpp::run_once()) + { bot.global_command_create( dpp::slashcommand("ping", "Ping pong!", bot.me.id) ); } }); + bot.on_message_create([&bot](auto event) { + BLT_TRACE("(%s)> %s", event.msg.author.username.c_str(), event.msg.content.c_str()); + if (event.msg.author.username == "") + { + + } + }); + bot.start(dpp::st_wait); return 0; std::cout << "Hello, World!" << std::endl;