Don't rely on exceptions, properly handle content lengths
This commit is contained in:
parent
a39f297669
commit
37bcf14762
1 changed files with 4 additions and 4 deletions
|
@ -6,7 +6,6 @@ from io import BytesIO
|
|||
import psutil
|
||||
from aiofile import AIOFile, LineReader
|
||||
from dis_snek import PrefixedContext, Scale, Snake, prefixed_command
|
||||
from dis_snek.client.errors import HTTPException
|
||||
from dis_snek.models.discord.embed import EmbedField
|
||||
from dis_snek.models.discord.file import File
|
||||
from rich.console import Console
|
||||
|
@ -104,9 +103,10 @@ class BotutilCog(Scale):
|
|||
embed.set_thumbnail(url="https://dev.zevaryx.com/git.png")
|
||||
|
||||
self.logger.info("Updates applied")
|
||||
try:
|
||||
await ctx.reply(f"```ansi\n{capture.get()}\n```", embed=embed)
|
||||
except HTTPException:
|
||||
content = f"```ansi\n{capture.get()}\n```"
|
||||
if len(content) < 3000:
|
||||
await ctx.reply(content, embed=embed)
|
||||
else:
|
||||
await ctx.reply(f"Total Changes: {status.lines['total_lines']}", embed=embed)
|
||||
|
||||
else:
|
||||
|
|
Loading…
Add table
Reference in a new issue