From c507bafa87bfabc3aab28c2d8104da407f1bba6d Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Wed, 1 Jan 2025 17:56:48 -0500 Subject: [PATCH] properly handle single lines being too long --- nomen/notifications.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nomen/notifications.py b/nomen/notifications.py index dcb5209..9137e40 100644 --- a/nomen/notifications.py +++ b/nomen/notifications.py @@ -75,9 +75,12 @@ async def handle_notification(db_updates, ctx, message, keyword, user_id, use_em paginator.add_line(header) paginator.add_line(empty=True) for line in indent(message.content, "> ", lambda line: True).strip().split("\n"): - paginator.add_line(line) + if len(line) < 1990: + paginator.add_line(line) + else: + paginator.add_line(line[:1975] + " (... Line too long)") paginator.add_line(empty=True) - paginator.add_file(footer) + paginator.add_line(footer) try: for page in paginator.pages: await member.send(page)