python-telegram-bot/telegram/forcereply.py

24 lines
603 B
Python
Raw Normal View History

#!/usr/bin/env python
2015-08-09 00:09:24 +02:00
from .replymarkup import ReplyMarkup
2015-08-09 00:09:24 +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
@staticmethod
def de_json(data):
return ForceReply(force_reply=data.get('force_reply', None),
selective=data.get('selective', None))
def to_dict(self):
data = {'force_reply': self.force_reply}
if self.selective:
data['selective'] = self.selective
return data