mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-11-25 08:37:07 +01:00
21 lines
667 B
Python
21 lines
667 B
Python
#!/usr/bin/env python
|
|
|
|
|
|
class Contact(object):
|
|
def __init__(self, **kwargs):
|
|
param_defaults = {
|
|
'phone_number': None,
|
|
'first_name': None,
|
|
'last_name': None,
|
|
'user_id': None
|
|
}
|
|
|
|
for (param, default) in param_defaults.iteritems():
|
|
setattr(self, param, kwargs.get(param, default))
|
|
|
|
@staticmethod
|
|
def newFromJsonDict(data):
|
|
return Contact(phone_number=data.get('phone_number', None),
|
|
first_name=data.get('first_name', None),
|
|
last_name=data.get('last_name', None),
|
|
user_id=data.get('user_id', None))
|