Create a convenient class to wrap Dialog instances

This commit is contained in:
Lonami Exo
2017-12-24 16:18:09 +01:00
parent 9c66f0b2b4
commit 238198db5a
4 changed files with 55 additions and 31 deletions

View File

@@ -35,12 +35,12 @@ def get_display_name(entity):
elif entity.last_name:
return entity.last_name
else:
return '(No name)'
return ''
if isinstance(entity, (Chat, Channel)):
elif isinstance(entity, (Chat, Channel)):
return entity.title
return '(unknown)'
return ''
# For some reason, .webp (stickers' format) is not registered
add_type('image/webp', '.webp')