mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-11-22 07:06:26 +01:00
24 lines
677 B
Python
24 lines
677 B
Python
#!/usr/bin/env python
|
|
|
|
|
|
import json
|
|
from .replymarkup import ReplyMarkup
|
|
|
|
|
|
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)
|