diff --git a/example/simple_example.cpp b/example/simple_example.cpp new file mode 100644 index 0000000000..3e6e2935c9 --- /dev/null +++ b/example/simple_example.cpp @@ -0,0 +1,23 @@ +#include +#include + +int main() { + dpp::cluster bot(std::getenv("BOT_TOKEN")); + + bot.on_slashcommand([](auto event) { + if (event.command.get_command_name() == "ping") { + event.reply("Pong!"); + } + }); + + bot.on_ready([&bot](auto event) { + if (dpp::run_once()) { + bot.global_command_create( + dpp::slashcommand("ping", "Ping pong!", bot.me.id) + ); + } + }); + + bot.start(dpp::st_wait); + return 0; +} \ No newline at end of file