Smarter body chunking

This commit is contained in:
Zeva Rose 2021-06-29 17:27:58 -06:00
parent 54fcd42247
commit 51b8809f21

View file

@ -69,14 +69,11 @@ class JokeCog(commands.Cog):
match, html.unescape(match)
)
body_chunks = []
for i in range(0, len(result["body"]), 1024):
body_chunks.append(
Field(
"",
result["body"][i * 1024 : (i + 1) * 1024],
False,
)
)
for chunk in result["body"].split("\n"):
if len(chunk) > 0:
body_chunks.append(Field("", chunk, False))
fields = body_chunks + [
Field("Score", result["score"]),
# Field(