[O] Try harder

This commit is contained in:
Hykilpikonna 2021-12-24 15:39:19 -05:00
parent 3eaa8228f2
commit ed782f6943
No known key found for this signature in database
GPG Key ID: 256CD01A41D7FA26

View File

@ -28,7 +28,10 @@ def process_audio(message: Message):
# Download audio file
date = datetime.now().strftime('%Y-%m-%d %H-%M')
downloader = bot.getFile(audio.file_id)
try:
downloader = bot.getFile(audio.file_id)
except:
downloader = bot.getFile(audio.file_id)
file = Path(tmpdir).joinpath(f'{date} {message.from_user.name[1:]}.mp3')
print(downloader, '->', file)
downloader.download(file)