Debian Codegraph @

docpages/example_code/clearing_slashcommands.cpp

raw symbols SCIP
1 #include <dpp/dpp.h>
2
3 int main() {
4 dpp::cluster bot("token");
5
6 bot.on_log(dpp::utility::cout_logger());
7
8 /* We won't be performing any commands, so we don't need to add the event here! */
9
10 bot.on_ready([&bot](const dpp::ready_t& event) {
11 if (dpp::run_once<struct clear_bot_commands>()) {
12 /* Now, we're going to wipe our commands */
13 bot.global_bulk_command_delete();
14 /* This one requires a guild id, otherwise it won't know what guild's commands it needs to wipe! */
15 bot.guild_bulk_command_delete(857692897221033129);
16 }
17
18 /* Because the run_once above uses a 'clear_bot_commands' struct, you can continue to register commands below! */
19 });
20
21 bot.start(dpp::st_wait);
22
23 return 0;
24 }