split list message

This commit is contained in:
bakatrouble 2023-04-10 03:55:29 +03:00
parent 921bf45ce5
commit 5554783d79

View File

@ -132,7 +132,14 @@ async def list_tags(msg: Message):
tags.sort()
lines = []
for tag in tags:
entry = f'- {tag} [/del_{tag}]'
if len('\n'.join(lines + [entry])) > 4096:
lines = "\n".join(lines)
await msg.reply(f'Monitored tags:\n\n{lines}')
lines = [entry]
else:
lines.append(f'- {tag} [/del_{tag}]')
lines = "\n".join(lines)
await msg.reply(f'Monitored tags:\n\n{lines}')