diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2023-12-07 21:14:52 +0000 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2023-12-07 21:14:52 +0000 |
commit | 295dd1906a98913275145c5b9cc403f1e76cfd33 (patch) | |
tree | f45d7721c9a138b743ada905a12596f050a7473d /lingo.cpp | |
parent | 460edd4191229635e86c0e3781a361126c140ca9 (diff) | |
parent | a37605e3d7d17e322a9cf2a497768f6fd8b5d0a3 (diff) | |
download | lingo-295dd1906a98913275145c5b9cc403f1e76cfd33.tar.gz lingo-295dd1906a98913275145c5b9cc403f1e76cfd33.tar.bz2 lingo-295dd1906a98913275145c5b9cc403f1e76cfd33.zip |
Merge branch 'main' of /srv/git/lingo into main
Diffstat (limited to 'lingo.cpp')
-rw-r--r-- | lingo.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/lingo.cpp b/lingo.cpp index 1cfc9e3..cf5d033 100644 --- a/lingo.cpp +++ b/lingo.cpp | |||
@@ -982,13 +982,19 @@ private: | |||
982 | 982 | ||
983 | std::string solution = cached_puzzle_->solution; | 983 | std::string solution = cached_puzzle_->solution; |
984 | bot_->message_create(message, [this, solution](const dpp::confirmation_callback_t& userdata) { | 984 | bot_->message_create(message, [this, solution](const dpp::confirmation_callback_t& userdata) { |
985 | const auto& posted_msg = std::get<dpp::message>(userdata.value); | 985 | if (!userdata.is_error()) { |
986 | std::lock_guard answer_lock(answers_mutex_); | 986 | const auto& posted_msg = std::get<dpp::message>(userdata.value); |
987 | if (answer_by_message_.size() > 3000) | 987 | std::lock_guard answer_lock(answers_mutex_); |
988 | { | 988 | if (answer_by_message_.size() > 3000) |
989 | answer_by_message_.clear(); | 989 | { |
990 | answer_by_message_.clear(); | ||
991 | } | ||
992 | if (posted_msg.id != 0) { | ||
993 | answer_by_message_[posted_msg.id] = solution; | ||
994 | } | ||
995 | } else { | ||
996 | std::cout << "Error posting message: " << userdata.get_error().message << std::endl; | ||
990 | } | 997 | } |
991 | answer_by_message_[posted_msg.id] = solution; | ||
992 | }); | 998 | }); |
993 | #endif | 999 | #endif |
994 | 1000 | ||