1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Implemented #17 (with some small adjustments) and ForceReply

Changed apihelper#convert_markup
Constructed the Jsonable abstract class. All subclasses must override Jsonable#to_json.
Made ReplyKeyboardHide, ReplyKeyboardMarkup and ForceReply a subclass of Jsonable to make things less complicated in convert_markup.
This commit is contained in:
pieter
2015-07-01 18:17:33 +02:00
parent 8812765652
commit b444565b7b
2 changed files with 38 additions and 4 deletions

View File

@ -146,10 +146,9 @@ def check_result(func_name, result):
return result_json
def convert_markup(markup):
if isinstance(markup, types.ReplyKeyboardMarkup):
if not isinstance(markup, types.Jsonable):
return markup.to_json()
else:
return markup
return markup
class ApiError(Exception):
def __init__(self, message, result):