mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-12-22 22:45:09 +01:00
24 lines
No EOL
641 B
Python
24 lines
No EOL
641 B
Python
#!/usr/bin/env python
|
|
|
|
|
|
import json
|
|
from .replymarkup import ReplyMarkup
|
|
|
|
|
|
class ForceReply(ReplyMarkup):
|
|
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_json(self):
|
|
json_data = {'force_reply': self.force_reply}
|
|
if self.selective:
|
|
json_data['selective'] = self.selective
|
|
return json.dumps(json_data) |