From 3b0ab7794b7399f126a0088d8d3ad9e3b5ec1118 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Sun, 25 Feb 2018 20:35:55 +0100 Subject: [PATCH] Get name attribute from streams instead always 'unnamed' --- telethon/telegram_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telethon/telegram_client.py b/telethon/telegram_client.py index 562a6d7e..a2bf5e85 100644 --- a/telethon/telegram_client.py +++ b/telethon/telegram_client.py @@ -1226,8 +1226,8 @@ class TelegramClient(TelegramBareClient): attr_dict[DocumentAttributeVideo] = doc else: attr_dict = { - DocumentAttributeFilename: - DocumentAttributeFilename('unnamed') + DocumentAttributeFilename: DocumentAttributeFilename( + getattr(file, 'name', None) or 'unnamed') } if 'is_voice_note' in kwargs: