Smarter body chunking
This commit is contained in:
parent
54fcd42247
commit
51b8809f21
1 changed files with 5 additions and 8 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Reference in a new issue