mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2025-01-18 15:20:42 +01:00
implement de_list
This commit is contained in:
parent
5cccf2603b
commit
5f19452dd7
1 changed files with 18 additions and 0 deletions
|
@ -51,3 +51,21 @@ class MessageEntity(TelegramObject):
|
|||
data = super(MessageEntity, MessageEntity).de_json(data)
|
||||
|
||||
return MessageEntity(**data)
|
||||
|
||||
@staticmethod
|
||||
def de_list(data):
|
||||
"""
|
||||
Args:
|
||||
data (list):
|
||||
|
||||
Returns:
|
||||
List<telegram.MessageEntity>:
|
||||
"""
|
||||
if not data:
|
||||
return list()
|
||||
|
||||
entities = list()
|
||||
for entity in data:
|
||||
entities.append(MessageEntity.de_json(entity))
|
||||
|
||||
return entities
|
||||
|
|
Loading…
Reference in a new issue