From 9069514f8425932ef998fc8a80b514eb81c88025 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Mon, 6 May 2024 00:47:00 +0500 Subject: fix?: i dont remember what i tried to fix there --- src/commands/request_util.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/commands/request_util.cpp b/src/commands/request_util.cpp index b51abee..fe1d1d4 100644 --- a/src/commands/request_util.cpp +++ b/src/commands/request_util.cpp @@ -174,16 +174,14 @@ namespace bot::command { } std::optional subcommand_id = parts[0]; - if (subcommand_id->empty()) { - subcommand_id = std::nullopt; - } - auto subcommand_ids = (*cmd)->get_subcommand_ids(); - if (subcommand_id != std::nullopt && - std::any_of(subcommand_ids.begin(), subcommand_ids.end(), - [&](const auto &x) { return x == subcommand_id; })) { + if (std::any_of( + subcommand_ids.begin(), subcommand_ids.end(), + [&](const auto &x) { return x == subcommand_id.value(); })) { parts.erase(parts.begin()); + } else { + subcommand_id = std::nullopt; } std::optional message = utils::string::join_vector(parts, ' '); -- cgit v1.2.3