PLG: telegram cleanup

This commit is contained in:
jokob-sk
2026-07-22 08:04:34 +10:00
parent d8e8939a37
commit 123fe320e8

View File

@@ -89,7 +89,7 @@ def send(text):
# never exceeds TELEGRAM_SIZE.
truncation_marker = " (text was truncated)"
if len(text) > limit:
payload_data = text[:max(0, limit - len(truncation_marker))] + truncation_marker
payload_data = (text[:max(0, limit - len(truncation_marker))] + truncation_marker)[:limit]
else:
payload_data = text