From 961ae9a725cf966498eec9d53e2891d21e3c29a0 Mon Sep 17 00:00:00 2001 From: Mathias Wagner Date: Sat, 4 Nov 2023 23:59:26 +0100 Subject: [PATCH] Added new commands to the ready.cpp --- src/listeners/ready.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/listeners/ready.cpp b/src/listeners/ready.cpp index c3d1f0e..0f6a2b0 100644 --- a/src/listeners/ready.cpp +++ b/src/listeners/ready.cpp @@ -26,9 +26,25 @@ void ready::execute(dpp::cluster &bot, const dpp::ready_t &event) { if (dpp::run_once()) { bot.global_command_create(dpp::slashcommand("rules", "Shows you the rules of the global chat", bot.me.id)); bot.global_command_create(dpp::slashcommand("add", "Transforms the channel into a global channel", bot.me.id)); - bot.global_command_create(dpp::slashcommand("remove", "Removes the channel from the global chat", bot.me.id).add_option( - dpp::command_option(dpp::co_channel, "channel", "The channel to remove", false))); + bot.global_command_create( + dpp::slashcommand("remove", "Removes the channel from the global chat", bot.me.id).add_option( + dpp::command_option(dpp::co_channel, "channel", "The channel to remove", false))); bot.global_command_create(dpp::slashcommand("clear", "Removes all global channels", bot.me.id)); + bot.global_command_create(dpp::slashcommand("coins", "Gets the current amount of StarCoins", bot.me.id)); + + dpp::command_option topic = dpp::command_option(dpp::co_string, "topic", "The topic of the global channel",true) + .add_choice(dpp::command_option_choice("General", "1")) + .add_choice(dpp::command_option_choice("Gaming", "2")) + .add_choice(dpp::command_option_choice("Programming", "3")) + .add_choice(dpp::command_option_choice("Politics", "4")); + + dpp::command_option language = dpp::command_option(dpp::co_string, "language", "The language of the global channel",true) + .add_choice(dpp::command_option_choice("English", "en")) + .add_choice(dpp::command_option_choice("German", "de")); + + bot.global_command_create(dpp::slashcommand("channel", "Test", bot.me.id) + .add_option(dpp::command_option(dpp::co_sub_command, "topic","Changes the topic of the global channel").add_option(topic)) + .add_option(dpp::command_option(dpp::co_sub_command, "language","Changes the language of the global channel").add_option(language))); bot.global_command_create(dpp::slashcommand().set_name("Report User").set_type(dpp::ctxm_message)); }