2015-07-09 02:15:46 +02:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
|
|
|
|
import json
|
2015-07-12 15:39:11 +02:00
|
|
|
from .replymarkup import ReplyMarkup
|
2015-07-09 02:15:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
class ForceReply(ReplyMarkup):
|
2015-07-09 02:58:13 +02:00
|
|
|
def __init__(self,
|
|
|
|
force_reply=True,
|
|
|
|
selective=None):
|
|
|
|
self.force_reply = force_reply
|
|
|
|
self.selective = selective
|
2015-07-09 02:15:46 +02:00
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def de_json(data):
|
|
|
|
return ForceReply(force_reply=data.get('force_reply', None),
|
|
|
|
selective=data.get('selective', None))
|
|
|
|
|
|
|
|
def to_json(self):
|
|
|
|
json_data = {'force_reply': self.force_reply}
|
|
|
|
if self.selective:
|
|
|
|
json_data['selective'] = self.selective
|
|
|
|
return json.dumps(json_data)
|
2015-07-09 16:40:44 +02:00
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
return self.to_json()
|