스킵 구현

This commit is contained in:
2023-12-20 19:45:25 +09:00
parent 6503fd167b
commit 8a987320e0
775 changed files with 162601 additions and 135 deletions

View File

@@ -0,0 +1,38 @@
#include <dpp/dpp.h>
int main() {
dpp::cluster bot("token");
bot.on_log(dpp::utility::cout_logger());
/* The event is fired when someone issues your commands */
bot.on_slashcommand([&bot](const dpp::slashcommand_t & event) {
/* Check which command they ran */
if (event.command.get_command_name() == "ping") {
event.reply("Pong!");
} else if (event.command.get_command_name() == "pong") {
event.reply("Ping!");
} else if (event.command.get_command_name() == "ding") {
event.reply("Dong!");
} else if (event.command.get_command_name() == "dong") {
event.reply("Ding!");
}
});
bot.on_ready([&bot](const dpp::ready_t & event) {
if (dpp::run_once<struct register_bot_commands>()) {
/* Create some commands */
dpp::slashcommand pingcommand("ping", "Pong!", bot.me.id);
dpp::slashcommand pongcommand("pong", "Ping!", bot.me.id);
dpp::slashcommand dingcommand("ding", "Dong!", bot.me.id);
dpp::slashcommand dongcommand("dong", "Ding!", bot.me.id);
/* Register our commands in a list using bulk */
bot.global_bulk_command_create({ pingcommand, pongcommand, dingcommand, dongcommand });
}
});
bot.start(dpp::st_wait);
return 0;
}