diff --git a/telethon/telegram_client.py b/telethon/telegram_client.py index 1dad2716..158855ad 100644 --- a/telethon/telegram_client.py +++ b/telethon/telegram_client.py @@ -1227,7 +1227,8 @@ class TelegramClient(TelegramBareClient): else: attr_dict = { DocumentAttributeFilename: DocumentAttributeFilename( - getattr(file, 'name', None) or 'unnamed') + os.path.basename( + getattr(file, 'name', None) or 'unnamed')) } if 'is_voice_note' in kwargs: