AudioAttachment
This commit is contained in:
@@ -109,6 +109,12 @@ def graphql_to_attachment(a):
|
|||||||
large_image=a.get('large_image'),
|
large_image=a.get('large_image'),
|
||||||
uid=a.get('legacy_attachment_id')
|
uid=a.get('legacy_attachment_id')
|
||||||
)
|
)
|
||||||
|
elif _type == 'MessageAudio':
|
||||||
|
return AudioAttachment(
|
||||||
|
filename=a.get('filename'),
|
||||||
|
playable_url=a.get('playable_url'),
|
||||||
|
duration=a.get('playable_duration_in_ms')
|
||||||
|
)
|
||||||
elif _type == 'MessageFile':
|
elif _type == 'MessageFile':
|
||||||
return FileAttachment(
|
return FileAttachment(
|
||||||
url=a.get('url'),
|
url=a.get('url'),
|
||||||
|
@@ -267,10 +267,20 @@ class FileAttachment(Attachment):
|
|||||||
self.name = name
|
self.name = name
|
||||||
self.is_malicious = is_malicious
|
self.is_malicious = is_malicious
|
||||||
|
|
||||||
class AudioAttachment(FileAttachment):
|
class AudioAttachment(Attachment):
|
||||||
def __init__(self, **kwargs):
|
# Name of the file
|
||||||
"""Represents an audio file that has been sent as a Facebook attachment - *Currently Incomplete!*"""
|
filename = None
|
||||||
super(StickerAttachment, self).__init__(**kwargs)
|
# playable_url
|
||||||
|
playable_url = None
|
||||||
|
# duration
|
||||||
|
duration = None
|
||||||
|
|
||||||
|
def __init__(self, filename=None, playable_url=None, duration=None, **kwargs):
|
||||||
|
"""Represents an audio file that has been sent as a Facebook attachment"""
|
||||||
|
super(AudioAttachment, self).__init__(**kwargs)
|
||||||
|
self.filename = filename
|
||||||
|
self.playable_url = playable_url
|
||||||
|
self.duration = duration
|
||||||
|
|
||||||
class ImageAttachment(Attachment):
|
class ImageAttachment(Attachment):
|
||||||
#: The extension of the original image (eg. 'png')
|
#: The extension of the original image (eg. 'png')
|
||||||
|
Reference in New Issue
Block a user