python-telegram-bot/telegram/groupchat.py

22 lines
509 B
Python
Raw Normal View History

2015-07-07 21:50:36 +02:00
#!/usr/bin/env python
class GroupChat(object):
def __init__(self, **kwargs):
param_defaults = {
'id': None,
'title': None
}
for (param, default) in param_defaults.iteritems():
setattr(self, param, kwargs.get(param, default))
2015-07-08 14:17:18 +02:00
@property
def chat_id(self):
return self.id
2015-07-07 21:50:36 +02:00
@staticmethod
def newFromJsonDict(data):
return GroupChat(id=data.get('id', None),
title=data.get('title', None))