aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Wang2022-03-23 15:50:56 -0500
committerAnthony Wang2022-03-23 15:50:56 -0500
commitfc56d2c0a873945e0b5f8720f3f75fd02c0c1602 (patch)
tree2b30af1ce6da5aa8cf19d76834bb94f13308cf89
parent3de96f721a228b5059904aca9436b43f40723029 (diff)
Make sure output has multiple lines if post isn't long enough
-rw-r--r--bot.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/bot.py b/bot.py
index 1c77fbc..9455406 100644
--- a/bot.py
+++ b/bot.py
@@ -78,9 +78,10 @@ print(output)
# Prepare the post
-post = output.split('\n')[0]
-if len(post) < 200:
- post = output.split('\n')[0] + '\n' + output.split('\n')[1]
+output = output.split('\n')
+post = output[0]
+if len(post) < 200 and len(output) > 1:
+ post = output[0] + '\n' + output[1]
post = post[:500]