Support Path-like values for thumb in _file_to_media (#1095)

This commit is contained in:
Kirill 2019-01-22 20:52:53 +03:00 committed by Lonami
parent bb5c1f24c6
commit 747caf1652

View File

@ -463,6 +463,8 @@ class UploadMethods(ButtonMethods, MessageParseMethods, UserMethods):
input_kw = {}
if thumb:
if isinstance(thumb, pathlib.Path):
thumb = str(thumb.absolute())
input_kw['thumb'] = await self.upload_file(thumb)
media = types.InputMediaUploadedDocument(