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
|
import psutil
|
||||||
from aiofile import AIOFile, LineReader
|
from aiofile import AIOFile, LineReader
|
||||||
from dis_snek import PrefixedContext, Scale, Snake, prefixed_command
|
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.embed import EmbedField
|
||||||
from dis_snek.models.discord.file import File
|
from dis_snek.models.discord.file import File
|
||||||
from rich.console import Console
|
from rich.console import Console
|
||||||
|
@ -104,9 +103,10 @@ class BotutilCog(Scale):
|
||||||
embed.set_thumbnail(url="https://dev.zevaryx.com/git.png")
|
embed.set_thumbnail(url="https://dev.zevaryx.com/git.png")
|
||||||
|
|
||||||
self.logger.info("Updates applied")
|
self.logger.info("Updates applied")
|
||||||
try:
|
content = f"```ansi\n{capture.get()}\n```"
|
||||||
await ctx.reply(f"```ansi\n{capture.get()}\n```", embed=embed)
|
if len(content) < 3000:
|
||||||
except HTTPException:
|
await ctx.reply(content, embed=embed)
|
||||||
|
else:
|
||||||
await ctx.reply(f"Total Changes: {status.lines['total_lines']}", embed=embed)
|
await ctx.reply(f"Total Changes: {status.lines['total_lines']}", embed=embed)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Reference in a new issue