properly handle single lines being too long

This commit is contained in:
Infinidoge 2025-01-01 17:56:48 -05:00
parent 522a2ee204
commit c507bafa87
Signed by: Infinidoge
SSH key fingerprint: SHA256:EMoPe5e2dO0gEvtBb2xkZTz5dkyL0rBmuiGTKG5s96E

View file

@ -75,9 +75,12 @@ async def handle_notification(db_updates, ctx, message, keyword, user_id, use_em
paginator.add_line(header) paginator.add_line(header)
paginator.add_line(empty=True) paginator.add_line(empty=True)
for line in indent(message.content, "> ", lambda line: True).strip().split("\n"): for line in indent(message.content, "> ", lambda line: True).strip().split("\n"):
if len(line) < 1990:
paginator.add_line(line) paginator.add_line(line)
else:
paginator.add_line(line[:1975] + " (... Line too long)")
paginator.add_line(empty=True) paginator.add_line(empty=True)
paginator.add_file(footer) paginator.add_line(footer)
try: try:
for page in paginator.pages: for page in paginator.pages:
await member.send(page) await member.send(page)