From 74e26dcfa918f72a66a6e88b9443d5c187912cb1 Mon Sep 17 00:00:00 2001 From: Jaskowicz1 <46899449+Jaskowicz1@users.noreply.github.com> Date: Fri, 13 Oct 2023 08:51:06 +0100 Subject: [PATCH] fix: fixed MicrowaveCommand so it no longer breaks --- CMakeLists.txt | 12 ++++++++++++ src/Commands/AvatarCommand.cpp | 4 ++-- src/Commands/MicrowaveCommand.cpp | 7 +++---- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d751d64..8fcca71 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,18 @@ add_executable(${PROJECT_NAME} ${bude_src} # Much love to GLOB <3 ) +# =============================================== +# Stuff for registering commands via Jenkins + +set(REGISTER_COMMANDS, on) + +if (REGISTER_COMMANDS) + target_compile_definitions(${PROJECT_NAME} REGISTER_COMMANDS) +endif () + +# Registering commands stuff over. +# =============================================== + # =============================================== # Required stuff for coro: diff --git a/src/Commands/AvatarCommand.cpp b/src/Commands/AvatarCommand.cpp index cc842f7..9892889 100644 --- a/src/Commands/AvatarCommand.cpp +++ b/src/Commands/AvatarCommand.cpp @@ -9,8 +9,8 @@ dpp::coroutine AvatarCommand::Execute(dpp::slashcommand_t event) { dpp::user* user = dpp::find_user(user_id); if(!user) { - event.reply("I failed to find that user. Please try again later. If the issue persists, please get in contact!"); - co_return; + event.reply("I failed to find that user. Please try again later. If the issue persists, please get in contact!"); + co_return; } dpp::embed embed = EmbedBuilder::BasicEmbed(dpp::colours::aqua,user->username + "'s Avatar!", diff --git a/src/Commands/MicrowaveCommand.cpp b/src/Commands/MicrowaveCommand.cpp index 67364cb..25f6d0a 100644 --- a/src/Commands/MicrowaveCommand.cpp +++ b/src/Commands/MicrowaveCommand.cpp @@ -6,7 +6,8 @@ dpp::coroutine MicrowaveCommand::Execute(dpp::slashcommand_t event) { std::string item = event.get_parameter("item").index() == 0 ? "food" : std::get(event.get_parameter("item")); if(item == BUDe::botRef->me.get_mention()) { - co_return event.reply(dpp::message("Beep Boop what are you doing step-cyborg?").set_flags(dpp::m_ephemeral)); + event.reply(dpp::message("Beep Boop what are you doing step-cyborg?").set_flags(dpp::m_ephemeral)); + co_return; } co_await event.co_reply("mmmmmmmmmmmmmmmmmmmmmmmmmmm"); @@ -28,10 +29,8 @@ dpp::coroutine MicrowaveCommand::Execute(dpp::slashcommand_t event) { std::string message = "Ding! Your " + item + " is ready!"; - std::cout << message << "\n"; - if(item_lower == "iphone" || item_lower == "samsung" || item_lower == "phone") { - message = "Di- Oh. It appears the phone may have blown up."; + message = "Di- Oh. It appears the phone has blown up."; } event.edit_response(message);