Skip to content

Commit

Permalink
fix: fixed MicrowaveCommand so it no longer breaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaskowicz1 committed Oct 13, 2023
1 parent 0f72994 commit 74e26dc
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
4 changes: 2 additions & 2 deletions src/Commands/AvatarCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ dpp::coroutine<void> 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!",
Expand Down
7 changes: 3 additions & 4 deletions src/Commands/MicrowaveCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ dpp::coroutine<void> MicrowaveCommand::Execute(dpp::slashcommand_t event) {
std::string item = event.get_parameter("item").index() == 0 ? "food" : std::get<std::string>(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");
Expand All @@ -28,10 +29,8 @@ dpp::coroutine<void> 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);
Expand Down

0 comments on commit 74e26dc

Please sign in to comment.