diff --git a/.gitignore b/.gitignore index d75c262..81c5340 100644 --- a/.gitignore +++ b/.gitignore @@ -47,3 +47,4 @@ CMakeUserPresets.json *.app build/ +.cache/ diff --git a/src/main.cpp b/src/main.cpp index e69de29..83f2748 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -0,0 +1,29 @@ +#include "../token.h" +#include +#include +#include +#include + +int main(int argc, char **argv) { + dpp::cluster bot(TOKEN); + + // Neat utility + bot.on_log(dpp::utility::cout_logger()); + + bot.on_slashcommand([](const dpp::slashcommand_t &event) { + if (event.command.get_command_name() == "test") { + event.reply("Recieved"); + } + }); + + bot.on_ready([&bot](const dpp::ready_t &event) { + if (dpp::run_once()) { + bot.global_command_create( + dpp::slashcommand("test", "quick test", bot.me.id)); + } + }); + + // Remove dpp::st_wait if you want it to return execution + // (so like async I assume?) + bot.start(dpp::st_wait); +} diff --git a/token.h b/token.h new file mode 100644 index 0000000..8a8bdae --- /dev/null +++ b/token.h @@ -0,0 +1 @@ +#define TOKEN "Insert your token here"