Sending open()'ed files would make their name the entire path

This commit is contained in:
Lonami Exo 2018-02-26 14:14:44 +01:00
parent 5a54e2279f
commit 8d1b6629cb

View File

@ -1227,7 +1227,8 @@ class TelegramClient(TelegramBareClient):
else: else:
attr_dict = { attr_dict = {
DocumentAttributeFilename: DocumentAttributeFilename( DocumentAttributeFilename: DocumentAttributeFilename(
getattr(file, 'name', None) or 'unnamed') os.path.basename(
getattr(file, 'name', None) or 'unnamed'))
} }
if 'is_voice_note' in kwargs: if 'is_voice_note' in kwargs: