mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-11-30 04:02:49 +01:00
25 lines
521 B
Python
25 lines
521 B
Python
#!/usr/bin/env python
|
|
|
|
|
|
import json
|
|
|
|
|
|
class GroupChat(object):
|
|
def __init__(self,
|
|
id,
|
|
title):
|
|
self.id = id
|
|
self.title = title
|
|
|
|
@staticmethod
|
|
def de_json(data):
|
|
return GroupChat(id=data.get('id', None),
|
|
title=data.get('title', None))
|
|
|
|
def to_json(self):
|
|
json_data = {'id': self.id,
|
|
'title': self.title}
|
|
return json.dumps(json_data)
|
|
|
|
def __str__(self):
|
|
return self.to_json()
|