Logical error in Bot().split_message_text method

This commit is contained in:
Davte 2019-07-12 14:31:09 +02:00
parent 7129e20e31
commit b03b24fb2d

View File

@ -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