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) match, html.unescape(match)
) )
body_chunks = [] body_chunks = []
for i in range(0, len(result["body"]), 1024):
body_chunks.append( for chunk in result["body"].split("\n"):
Field( if len(chunk) > 0:
"", body_chunks.append(Field("", chunk, False))
result["body"][i * 1024 : (i + 1) * 1024],
False,
)
)
fields = body_chunks + [ fields = body_chunks + [
Field("Score", result["score"]), Field("Score", result["score"]),
# Field( # Field(