Merge pull request #254 from sdnian/bransh1
modify AudioAttachment function
This commit is contained in:
@@ -109,6 +109,13 @@ def graphql_to_attachment(a):
|
||||
large_image=a.get('large_image'),
|
||||
uid=a.get('legacy_attachment_id')
|
||||
)
|
||||
elif _type == 'MessageAudio':
|
||||
return AudioAttachment(
|
||||
filename=a.get('filename'),
|
||||
url=a.get('playable_url'),
|
||||
duration=a.get('playable_duration_in_ms'),
|
||||
audio_type=a.get('audio_type')
|
||||
)
|
||||
elif _type == 'MessageFile':
|
||||
return FileAttachment(
|
||||
url=a.get('url'),
|
||||
|
@@ -267,10 +267,23 @@ class FileAttachment(Attachment):
|
||||
self.name = name
|
||||
self.is_malicious = is_malicious
|
||||
|
||||
class AudioAttachment(FileAttachment):
|
||||
def __init__(self, **kwargs):
|
||||
"""Represents an audio file that has been sent as a Facebook attachment - *Currently Incomplete!*"""
|
||||
super(StickerAttachment, self).__init__(**kwargs)
|
||||
class AudioAttachment(Attachment):
|
||||
#: Name of the file
|
||||
filename = None
|
||||
#: Url of the audio file
|
||||
url = None
|
||||
#: Duration of the audioclip in milliseconds
|
||||
duration = None
|
||||
#: Audio type
|
||||
audio_type = None
|
||||
|
||||
def __init__(self, filename=None, url=None, duration=None, audio_type=None, **kwargs):
|
||||
"""Represents an audio file that has been sent as a Facebook attachment"""
|
||||
super(AudioAttachment, self).__init__(**kwargs)
|
||||
self.filename = filename
|
||||
self.url = url
|
||||
self.duration = duration
|
||||
self.audio_type = audio_type
|
||||
|
||||
class ImageAttachment(Attachment):
|
||||
#: The extension of the original image (eg. 'png')
|
||||
|
Reference in New Issue
Block a user