diff --git a/bot/handlers/leech_handler.py b/bot/handlers/leech_handler.py index 5fb40dfa..4edeb0d2 100644 --- a/bot/handlers/leech_handler.py +++ b/bot/handlers/leech_handler.py @@ -92,8 +92,8 @@ async def progress_dl(message : Message, aria2_api : aria2.aria2, gid : int, pre if not download.is_complete: if not download.error_message: block = "" - for i in range(1, CONFIG.BAR_SIZE + 1): - if i <= floor(download.progress * CONFIG.BAR_SIZE/100): + for i in range(1, int(CONFIG.BAR_SIZE) + 1): + if i <= floor(download.progress * int(CONFIG.BAR_SIZE)/100): block += LOCAL.BLOCK_FILLED else: block += LOCAL.BLOCK_EMPTY diff --git a/bot/handlers/upload_to_tg_handler.py b/bot/handlers/upload_to_tg_handler.py index ba865d88..1dfb1e09 100644 --- a/bot/handlers/upload_to_tg_handler.py +++ b/bot/handlers/upload_to_tg_handler.py @@ -117,8 +117,8 @@ async def upload_fn(chat_id, file, **kwargs): async def progress_upload_tg(current, total, message, info): percentage = round(current * 10000 / total) / 100 block = "" - for i in range(1, CONFIG.BAR_SIZE + 1): - if i <= floor(percentage * CONFIG.BAR_SIZE/100): + for i in range(1, int(CONFIG.BAR_SIZE) + 1): + if i <= floor(percentage * int(CONFIG.BAR_SIZE)/100): block += LOCAL.BLOCK_FILLED else: block += LOCAL.BLOCK_EMPTY