fix truncate messages

This commit is contained in:
Carl Chenet 2019-12-31 12:10:50 +01:00
parent b7430f3b10
commit 976fc03224

View File

@ -48,6 +48,7 @@ def build_message(entrytosend, tweetformat, rss, tootmaxlen, notagsintoot):
finaltweet = BeautifulSoup(finaltweet, 'html.parser').get_text() finaltweet = BeautifulSoup(finaltweet, 'html.parser').get_text()
# truncate toot to user-defined value whatever the content is # truncate toot to user-defined value whatever the content is
if len(finaltweet) > tootmaxlen: if len(finaltweet) > tootmaxlen:
finaltweet = finaltweet[0:tootmaxlen-1]
return ''.join([finaltweet[0:-3], '...']) return ''.join([finaltweet[0:-3], '...'])
else: else:
return finaltweet return finaltweet