Token file
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -47,3 +47,4 @@ CMakeUserPresets.json
|
|||||||
*.app
|
*.app
|
||||||
|
|
||||||
build/
|
build/
|
||||||
|
.cache/
|
||||||
|
29
src/main.cpp
29
src/main.cpp
@@ -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);
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user