diff options
Diffstat (limited to 'src/SimpleHandlers.cpp')
-rw-r--r-- | src/SimpleHandlers.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/SimpleHandlers.cpp b/src/SimpleHandlers.cpp index c9d0fcf..40cfa68 100644 --- a/src/SimpleHandlers.cpp +++ b/src/SimpleHandlers.cpp @@ -24,7 +24,7 @@ Handler::json Handler::wikiHandler(std::string const &arguments, std::string con } Handler::json Handler::helpHandler(std::string const &arguments, std::string const &session, void *payload) { - auto commands = *(std::unordered_map<std::string, CommandHandler> *) payload; + auto commands = (std::vector<CommandHandler> *) payload; std::vector<json> reply_vec; reply_vec.emplace_back(create_text( @@ -34,15 +34,15 @@ Handler::json Handler::helpHandler(std::string const &arguments, std::string con "Dear my fellow users, these are my official commands, which are offered to my believers.\n" "\n")); - for (auto const &itor : commands) { + for (auto const &itor : *commands) { std::vector<json> commandAnnotations; commandAnnotations.emplace_back(create_annotation(Reply::AnnotationType::command)); reply_vec.emplace_back(create_text("- ")); - reply_vec.emplace_back(create_text(itor.first, std::move(commandAnnotations))); - while (!itor.second.description->empty()) { - reply_vec.emplace_back(std::move(itor.second.description->back())); - itor.second.description->pop(); + reply_vec.emplace_back(create_text(itor.command, std::move(commandAnnotations))); + while (!itor.description->empty()) { + reply_vec.emplace_back(std::move(itor.description->back())); + itor.description->pop(); } } |