mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-11-29 03:32:49 +01:00
21 lines
642 B
Python
21 lines
642 B
Python
#!/usr/bin/env python
|
|
|
|
|
|
class Audio(object):
|
|
def __init__(self, **kwargs):
|
|
param_defaults = {
|
|
'file_id': None,
|
|
'duration': None,
|
|
'mime_type': None,
|
|
'file_size': None
|
|
}
|
|
|
|
for (param, default) in param_defaults.iteritems():
|
|
setattr(self, param, kwargs.get(param, default))
|
|
|
|
@staticmethod
|
|
def newFromJsonDict(data):
|
|
return Audio(file_id=data.get('file_id', None),
|
|
duration=data.get('duration', None),
|
|
mime_type=data.get('mime_type', None),
|
|
file_size=data.get('file_size', None))
|