From 85a94138c89c8389f9828f097b3e96f8b94ed5d6 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Mon, 6 May 2024 09:25:53 -0400 Subject: don't post list of entries at start of round if message would be too long --- source.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source.cpp') diff --git a/source.cpp b/source.cpp index 9b5a122..dc5b39a 100644 --- a/source.cpp +++ b/source.cpp @@ -365,8 +365,13 @@ int main() { if (advanced) msg += "The only entry left in the previous round was \"" + *advanced + "\", so it advanced. "; msg += "There are " + std::to_string(left_for_this_round.size()) + " entries remaining:"; + std::string msg_backup = msg; for (int i = left_for_this_round.size() - 1; i >= 0; --i) msg += "\n* \"" + left_for_this_round[i] + "\""; + if (msg.size() > 2000) { + msg = std::move(msg_backup); + msg.back() = '.'; + } send_message(msg); } -- cgit v1.2.3