From b03b24fb2d38783693d7ff5cf9fea1c0461657d4 Mon Sep 17 00:00:00 2001 From: Davte Date: Fri, 12 Jul 2019 14:31:09 +0200 Subject: [PATCH] Logical error in `Bot().split_message_text` method --- davtelepot/bot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/davtelepot/bot.py b/davtelepot/bot.py index 4efe386..b831251 100644 --- a/davtelepot/bot.py +++ b/davtelepot/bot.py @@ -829,10 +829,10 @@ class Bot(TelegramBot, ObjectWithDatabase): text[-1] = text[-1][limit:] text_chunk = "\n".join(temp) # Re-join this group of lines prefix, suffix = '', '' - is_last = len(text) > 0 + is_last = len(text) == 0 if text_part_number > 1: prefix = f"{tags[0]}[...]{tags[1]}\n" - if is_last: + if not is_last: suffix = f"\n{tags[0]}[...]{tags[1]}" yield (prefix + text_chunk + suffix), is_last return