diff --git a/fbchat/graphql.py b/fbchat/graphql.py index 680b07f..d8dd74b 100644 --- a/fbchat/graphql.py +++ b/fbchat/graphql.py @@ -75,7 +75,8 @@ def graphql_to_message(message): text=message.get('message').get('text'), mentions=[Mention(m.get('entity', {}).get('id'), offset=m.get('offset'), length=m.get('length')) for m in message.get('message').get('ranges', [])], sticker=message.get('sticker'), - attachments=message.get('blob_attachments') + attachments=message.get('blob_attachments'), + extensible_attachment=message.get('extensible_attachment') ) def graphql_to_user(user): diff --git a/fbchat/models.py b/fbchat/models.py index b1fbbf0..1697c28 100644 --- a/fbchat/models.py +++ b/fbchat/models.py @@ -125,8 +125,10 @@ class Message(object): sticker = str #: A list of attachments attachments = list + #: An extensible attachment, e.g. share object + extensible_attachment = dict - def __init__(self, uid, author=None, timestamp=None, is_read=None, reactions=[], text=None, mentions=[], sticker=None, attachments=[]): + def __init__(self, uid, author=None, timestamp=None, is_read=None, reactions=[], text=None, mentions=[], sticker=None, attachments=[], extensible_attachment={}): """Represents a Facebook message""" self.uid = uid self.author = author @@ -137,6 +139,7 @@ class Message(object): self.mentions = mentions self.sticker = sticker self.attachments = attachments + self.extensible_attachment = extensible_attachment class Mention(object):