From e342b9fa6bfab617ced4a69a49a80df9535c0254 Mon Sep 17 00:00:00 2001 From: eternnoir Date: Tue, 1 Nov 2016 01:10:06 +0800 Subject: [PATCH 1/2] Fix InlineQueryResultGame replymarkup do not to_dic. --- telebot/types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telebot/types.py b/telebot/types.py index 0faa38c..ea4b474 100644 --- a/telebot/types.py +++ b/telebot/types.py @@ -1480,7 +1480,7 @@ class InlineQueryResultGame(JsonSerializable): def to_json(self): json_dic = {'type': self.type, 'id': self.id, 'game_short_name': self.game_short_name} if self.reply_markup: - json_dic['reply_markup'] = self.reply_markup + json_dic['reply_markup'] = self.reply_markup.to_dic() return json.dumps(json_dic) From 7a6bb4dcc8c88298c8b2378d90893f9e999cecb9 Mon Sep 17 00:00:00 2001 From: eternnoir Date: Tue, 1 Nov 2016 01:14:28 +0800 Subject: [PATCH 2/2] Remove type in InlineQueryResultGame. --- telebot/types.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telebot/types.py b/telebot/types.py index ea4b474..f0c5953 100644 --- a/telebot/types.py +++ b/telebot/types.py @@ -1471,8 +1471,8 @@ class InlineQueryResultCachedAudio(BaseInlineQueryResultCached): # Games class InlineQueryResultGame(JsonSerializable): - def __init__(self, type, id, game_short_name, reply_markup=None): - self.type = type + def __init__(self, id, game_short_name, reply_markup=None): + self.type = 'game' self.id = id self.game_short_name = game_short_name self.reply_markup = reply_markup