From 37bcf1476296173e414b00e64cd66b1f42d57e0e Mon Sep 17 00:00:00 2001 From: Zevaryx Date: Mon, 2 May 2022 02:16:09 -0600 Subject: [PATCH] Don't rely on exceptions, properly handle content lengths --- jarvis/cogs/botutil.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jarvis/cogs/botutil.py b/jarvis/cogs/botutil.py index 2dd8649..8baff9a 100644 --- a/jarvis/cogs/botutil.py +++ b/jarvis/cogs/botutil.py @@ -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: