diff options
author | Benji Dial <benji@benjidial.net> | 2024-05-06 09:25:53 -0400 |
---|---|---|
committer | Benji Dial <benji@benjidial.net> | 2024-05-06 09:25:53 -0400 |
commit | 85a94138c89c8389f9828f097b3e96f8b94ed5d6 (patch) | |
tree | 2bb22b121ab93dfef716652a9b7e7a37326ec2a1 /source.cpp | |
parent | 379b35093097f0091e08e128c161000ead3d1e19 (diff) | |
download | bracket-bot-85a94138c89c8389f9828f097b3e96f8b94ed5d6.tar.gz |
don't post list of entries at start of round if message would be too long
Diffstat (limited to 'source.cpp')
-rw-r--r-- | source.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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); } |