fix(seautils): added a bad solution to a stupid problem
This commit is contained in:
parent
ac5d4df36b
commit
861a03719b
1 changed files with 28 additions and 8 deletions
|
@ -211,15 +211,35 @@ class SeaUtils(commands.Cog):
|
||||||
content = []
|
content = []
|
||||||
for pre_tag in pre_tags:
|
for pre_tag in pre_tags:
|
||||||
text = convert_rfc_references(md(pre_tag), number)
|
text = convert_rfc_references(md(pre_tag), number)
|
||||||
if await ctx.embed_requested():
|
if len(text) > 4096:
|
||||||
embed = Embed(
|
text1 = text[:4096]
|
||||||
title=f"RFC Document {number}",
|
text2 = text[4096:]
|
||||||
description=text,
|
if await ctx.embed_requested():
|
||||||
color=await ctx.embed_color()
|
embed = Embed(
|
||||||
)
|
title=f"RFC Document {number}",
|
||||||
content.append(embed)
|
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:
|
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)
|
await SimpleMenu(pages=content, disable_after_timeout=True, timeout=300).start(ctx)
|
||||||
else:
|
else:
|
||||||
await ctx.maybe_send_embed(content=cf.error(f"An error occurred while fetching RFC {number}. Status code: {response.status}."))
|
await ctx.maybe_send_embed(content=cf.error(f"An error occurred while fetching RFC {number}. Status code: {response.status}."))
|
||||||
|
|
Loading…
Reference in a new issue