add upload size

This commit is contained in:
BennyThink 2021-05-05 19:37:41 +08:00
parent 8f2ff8f8bf
commit 7d8987de69
No known key found for this signature in database
GPG key ID: 6CD0DBDA5235D481

View file

@ -127,7 +127,8 @@ async def upload_callback(current, total, chat_id, message):
# if the key exists, we shouldn't send edit message # if the key exists, we shouldn't send edit message
if not r.exists(key): if not r.exists(key):
r.set(key, "ok", ex=EXPIRE) r.set(key, "ok", ex=EXPIRE)
msg = f'Uploading {round(current / total * 100, 2)}%: {current}/{total}' filesize = sizeof_fmt(total)
msg = f'[{filesize}]: Uploading {round(current / total * 100, 2)}% - {current}/{total}'
await bot.edit_message(chat_id, message, msg) await bot.edit_message(chat_id, message, msg)