Token file

This commit is contained in:
2025-07-18 21:10:04 +03:00
parent 27e1138441
commit d7ffc1d5ba
3 changed files with 31 additions and 0 deletions

1
.gitignore vendored
View File

@@ -47,3 +47,4 @@ CMakeUserPresets.json
*.app
build/
.cache/

View File

@@ -0,0 +1,29 @@
#include "../token.h"
#include <dpp/cluster.h>
#include <dpp/dispatcher.h>
#include <dpp/dpp.h>
#include <dpp/once.h>
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<struct register_bot_commands>()) {
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);
}

1
token.h Normal file
View File

@@ -0,0 +1 @@
#define TOKEN "Insert your token here"