split list message
This commit is contained in:
parent
921bf45ce5
commit
5554783d79
7
main.py
7
main.py
@ -132,7 +132,14 @@ async def list_tags(msg: Message):
|
|||||||
tags.sort()
|
tags.sort()
|
||||||
lines = []
|
lines = []
|
||||||
for tag in tags:
|
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.append(f'- {tag} [/del_{tag}]')
|
||||||
|
|
||||||
lines = "\n".join(lines)
|
lines = "\n".join(lines)
|
||||||
await msg.reply(f'Monitored tags:\n\n{lines}')
|
await msg.reply(f'Monitored tags:\n\n{lines}')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user