Skip to content

Commit 1045319

Browse files
committed
Refactored InlineQueryResult types
1 parent 12aec0b commit 1045319

File tree

4 files changed

+92
-692
lines changed

4 files changed

+92
-692
lines changed

telebot/apihelper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def __init__(self, token, request_executor, api_url=API_URL, file_url=FILE_URL):
4343

4444
@staticmethod
4545
def convert_markup(markup):
46-
return markup.to_json() if isinstance(markup, types.JsonSerializable) else markup
46+
return types.to_json(markup)
4747

4848
@staticmethod
4949
def convert_inline_results(results):
@@ -52,7 +52,7 @@ def convert_inline_results(results):
5252
:param results: list of InlineQueryResult objects
5353
:rtype: str
5454
"""
55-
converted_results = [r.to_json() if isinstance(r, types.JsonSerializable) else r for r in results]
55+
converted_results = [types.to_json(r) for r in results]
5656
return '[' + ','.join(converted_results) + ']'
5757

5858
def make_request(self, method_name, params=None, files=None, method='get', response_type='json'):

0 commit comments

Comments
 (0)