fix error handling

This commit is contained in:
un1xx committed 2025-05-09 22:57:20 +05:30
1 parent b5863b9e27
commit 58908ee3d6
2 files changed
+17 -11

No files matched your search

+5 -3
View File
@@ -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")