From 4ca6b7f1d937c7f43adc49364a425cef0dddabfa Mon Sep 17 00:00:00 2001 From: nex Date: Sat, 4 Nov 2023 17:01:21 +0000 Subject: [PATCH] Fix filesize checker --- cogs/other.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cogs/other.py b/cogs/other.py index 93929c8..9c35267 100644 --- a/cogs/other.py +++ b/cogs/other.py @@ -914,7 +914,7 @@ class OtherCog(commands.Cog): MAX_SIZE_MB = ctx.guild.filesize_limit / 1024 / 1024 if MAX_SIZE_MB == 8.0: MAX_SIZE_MB = 25.0 - + REAL_MAX_SIZE_MB = MAX_SIZE_MB if disable_filesize_buffer is False: MAX_SIZE_MB *= 0.9 BYTES_REMAINING = (MAX_SIZE_MB - 0.256) * 1024 * 1024 @@ -1129,7 +1129,7 @@ class OtherCog(commands.Cog): embed.description += f"\N{warning sign}\ufe0f {file.name} is empty.\n" continue st = file.stat().st_size - if st / 1024 / 1024 >= MAX_SIZE_MB or st >= BYTES_REMAINING: + if st / 1024 / 1024 >= REAL_MAX_SIZE_MB: units = ["B", "KB", "MB", "GB", "TB"] st_r = st while st_r > 1024: @@ -1140,7 +1140,7 @@ class OtherCog(commands.Cog): file.name, round(st_r, 2), units[0], - MAX_SIZE_MB, + REAL_MAX_SIZE_MB, ) continue else: