mirror of
https://github.com/HappyTanuki/BumbleCee.git
synced 2025-12-18 21:23:29 +00:00
스킵 구현
This commit is contained in:
23
DPP-master/docpages/example_code/firstbot6.cpp
Normal file
23
DPP-master/docpages/example_code/firstbot6.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#include <dpp/dpp.h>
|
||||
|
||||
const std::string BOT_TOKEN = "add your token here";
|
||||
|
||||
int main() {
|
||||
dpp::cluster bot(BOT_TOKEN);
|
||||
|
||||
bot.on_log(dpp::utility::cout_logger());
|
||||
|
||||
bot.on_slashcommand([](const dpp::slashcommand_t& event) {
|
||||
if (event.command.get_command_name() == "ping") {
|
||||
event.reply("Pong!");
|
||||
}
|
||||
});
|
||||
|
||||
bot.on_ready([&bot](const dpp::ready_t& event) {
|
||||
if (dpp::run_once<struct register_bot_commands>()) {
|
||||
bot.global_command_create(dpp::slashcommand("ping", "Ping pong!", bot.me.id));
|
||||
}
|
||||
});
|
||||
|
||||
bot.start(dpp::st_wait);
|
||||
}
|
||||
Reference in New Issue
Block a user