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)
|
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(
|
||||||
|
|
Loading…
Add table
Reference in a new issue