Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <dpp/dpp.h>
- #include <iostream>
- int main(int argc, char* argv[])
- {
- dpp::cluster bot("rel");
- bot.on_log(dpp::utility::cout_logger());
- bot.on_ready([&bot](const dpp::ready_t& event) {
- if (dpp::run_once<struct register_bot_commands>()) {
- bot.global_command_create(
- dpp::slashcommand("button","Cool",bot.me.id)
- );
- }
- });
- bot.on_slashcommand([&bot](const dpp::slashcommand_t& event) {
- if (event.command.get_command_name() == "button") {
- event.reply(
- dpp::message(event.command.channel_id, "Here ya go").add_component(
- dpp::component()
- .set_type(dpp::cot_button)
- .set_style(dpp::cos_primary)
- .set_label("Button")
- .set_id("button")
- )
- );
- }
- });
- bot.on_button_click([&bot](const dpp::button_click_t& event) {
- if (event.custom_id == "button") {
- event.reply("MUAHAHAHHAHA YOU FELL INTO MY TRAP LOSER!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
- }
- });
- bot.start(dpp::st_wait);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement