From 5f19452dd7d23ee97ff8db50873c46df85f70361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannes=20H=C3=B6ke?= Date: Sun, 17 Apr 2016 12:43:09 +0200 Subject: [PATCH] implement de_list --- telegram/messageentity.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/telegram/messageentity.py b/telegram/messageentity.py index a712cefa7..179f74feb 100644 --- a/telegram/messageentity.py +++ b/telegram/messageentity.py @@ -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: + """ + if not data: + return list() + + entities = list() + for entity in data: + entities.append(MessageEntity.de_json(entity)) + + return entities