New model and Message
attribute
New `QuickReply` model and `quick_replies` attribute of `Message` model.
This commit is contained in:
committed by
GitHub
parent
0ae213c240
commit
f9245cdfed
@@ -188,8 +188,10 @@ class Message(object):
|
|||||||
sticker = None
|
sticker = None
|
||||||
#: A list of attachments
|
#: A list of attachments
|
||||||
attachments = None
|
attachments = None
|
||||||
|
#: A list of :class:`QuickReply`
|
||||||
|
quick_replies = None
|
||||||
|
|
||||||
def __init__(self, text=None, mentions=None, emoji_size=None, sticker=None, attachments=None):
|
def __init__(self, text=None, mentions=None, emoji_size=None, sticker=None, attachments=None, quick_replies=None):
|
||||||
"""Represents a Facebook message"""
|
"""Represents a Facebook message"""
|
||||||
self.text = text
|
self.text = text
|
||||||
if mentions is None:
|
if mentions is None:
|
||||||
@@ -200,6 +202,9 @@ class Message(object):
|
|||||||
if attachments is None:
|
if attachments is None:
|
||||||
attachments = []
|
attachments = []
|
||||||
self.attachments = attachments
|
self.attachments = attachments
|
||||||
|
if quick_replies is None:
|
||||||
|
quick_replies = []
|
||||||
|
self.quick_replies = quick_replies
|
||||||
self.reactions = {}
|
self.reactions = {}
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
@@ -439,6 +444,31 @@ class Mention(object):
|
|||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return '<Mention {}: offset={} length={}>'.format(self.thread_id, self.offset, self.length)
|
return '<Mention {}: offset={} length={}>'.format(self.thread_id, self.offset, self.length)
|
||||||
|
|
||||||
|
class QuickReply(object):
|
||||||
|
#: Title of the quick reply
|
||||||
|
title = None
|
||||||
|
#: URL of the quick reply image (optional)
|
||||||
|
image_url = None
|
||||||
|
#: Custom identifier of the quick reply
|
||||||
|
payload = None
|
||||||
|
#: Additional data
|
||||||
|
data = None
|
||||||
|
#: Whether it's a response for a quick reply
|
||||||
|
is_response = None
|
||||||
|
|
||||||
|
def __init__(self, title, image_url=None, payload=None, data=None):
|
||||||
|
"""Represents a quick reply"""
|
||||||
|
self.title = title
|
||||||
|
self.image_url = image_url
|
||||||
|
self.payload = payload
|
||||||
|
self.data = data
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
return self.__unicode__()
|
||||||
|
|
||||||
|
def __unicode__(self):
|
||||||
|
return '<QuickReply: title={!r} payload={!r}>'.format(self.title, self.payload)
|
||||||
|
|
||||||
class Poll(object):
|
class Poll(object):
|
||||||
#: ID of the poll
|
#: ID of the poll
|
||||||
uid = None
|
uid = None
|
||||||
|
Reference in New Issue
Block a user