Increased description limit for tweets

This commit is contained in:
Dylan
2023-02-17 18:10:23 +00:00
parent ae6774f126
commit 3717430c3f
2 changed files with 12 additions and 2 deletions

View File

@ -3,6 +3,8 @@ failedToScanExtra = "\n\nTwitter gave me this error: "
tweetNotFound="Tweet not found."
tweetSuspended="This Tweet is from a suspended account."
tweetDescLimit=340
def genLikesDisplay(vnf):
return ("\n\n💖 " + str(vnf['likes']) + " 🔁 " + str(vnf['rts']))
@ -38,9 +40,9 @@ def formatEmbedDesc(type,body,qrt,pollDisplay,likesDisplay):
output= body+pollDisplay+likesDisplay
else:
output= body + likesDisplay
if len(output)>248:
if len(output)>tweetDescLimit:
# find out how many characters we need to remove
diff = len(output)-248
diff = len(output)-tweetDescLimit
# remove the characters from body, add ellipsis
body = body[:-(diff+1)]+""
return formatEmbedDesc(type,body,qrt,pollDisplay,likesDisplay)