Don't rely on exceptions, properly handle content lengths

This commit is contained in:
Zeva Rose 2022-05-02 02:16:09 -06:00
parent a39f297669
commit 37bcf14762

View file

@ -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: