python-telegram-bot/telegram/replykeyboardhide.py

25 lines
677 B
Python
Raw Normal View History

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