From 861a03719bd8dd01db153f55fa5bf47c3a423b92 Mon Sep 17 00:00:00 2001 From: Seaswimmer Date: Tue, 28 May 2024 21:22:30 -0400 Subject: [PATCH] fix(seautils): added a bad solution to a stupid problem --- seautils/seautils.py | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/seautils/seautils.py b/seautils/seautils.py index 4db4bfc..fd6f25b 100644 --- a/seautils/seautils.py +++ b/seautils/seautils.py @@ -211,15 +211,35 @@ class SeaUtils(commands.Cog): content = [] for pre_tag in pre_tags: text = convert_rfc_references(md(pre_tag), number) - if await ctx.embed_requested(): - embed = Embed( - title=f"RFC Document {number}", - description=text, - color=await ctx.embed_color() - ) - content.append(embed) + if len(text) > 4096: + text1 = text[:4096] + text2 = text[4096:] + if await ctx.embed_requested(): + embed = Embed( + title=f"RFC Document {number}", + description=text1, + color=await ctx.embed_color() + ) + content.append(embed) + embed2 = Embed( + title=f"RFC Document {number}", + description=text2, + color=await ctx.embed_color() + ) + content.append(embed2) + else: + content.append(text1) + content.append(text2) else: - content.append(text) + if await ctx.embed_requested(): + embed = Embed( + title=f"RFC Document {number}", + description=text, + color=await ctx.embed_color() + ) + content.append(embed) + else: + content.append(text) await SimpleMenu(pages=content, disable_after_timeout=True, timeout=300).start(ctx) else: await ctx.maybe_send_embed(content=cf.error(f"An error occurred while fetching RFC {number}. Status code: {response.status}."))