fix error handling
This commit is contained in:
1 parent
b5863b9e27
commit
58908ee3d6
2 files changed
+17
-11
No files matched your search
+5
-3
@@ -34,18 +34,20 @@ class CustomCtx(Context):
|
||||
send content in a paginated codeblock
|
||||
"""
|
||||
codeblock = "```" + lang + "\n{}" + "\n```"
|
||||
if not len(content) > 1200:
|
||||
if not len(content) > 1900:
|
||||
await self.send(content=codeblock.format(content))
|
||||
return
|
||||
pages = []
|
||||
string = ""
|
||||
for p in content.splitlines("\n"):
|
||||
for p in content.splitlines():
|
||||
if not len(string) > 1900:
|
||||
string += p
|
||||
string += p + '\n'
|
||||
else:
|
||||
pages.append(codeblock.format(string))
|
||||
string = ""
|
||||
string += p
|
||||
if string:
|
||||
pages.append(string)
|
||||
await self.paginate(pages=pages, pagetype="text")
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user