mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-07-21 21:39:46 +03:00
Fixes file downloading error
`date`'s default value is `None`, so this function will crash if `name` is empty and `date` is not provided
This commit is contained in:
parent
605c103f29
commit
01c8bf2589
|
@ -967,6 +967,8 @@ class TelegramClient(TelegramBareClient):
|
|||
name = None
|
||||
|
||||
if not name:
|
||||
if not date:
|
||||
date = datetime.now()
|
||||
name = '{}_{}-{:02}-{:02}_{:02}-{:02}-{:02}'.format(
|
||||
kind,
|
||||
date.year, date.month, date.day,
|
||||
|
|
Loading…
Reference in New Issue
Block a user