mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2025-03-17 04:39:55 +01:00
Add game parameters in various places
Also chat_instance in CallbackQuery which will break a lot of tests probably
This commit is contained in:
parent
ae17eb3272
commit
551f6c556c
2 changed files with 6 additions and 1 deletions
|
@ -25,14 +25,16 @@ from telegram import TelegramObject, Message, User
|
|||
class CallbackQuery(TelegramObject):
|
||||
"""This object represents a Telegram CallbackQuery."""
|
||||
|
||||
def __init__(self, id, from_user, data, bot=None, **kwargs):
|
||||
def __init__(self, id, from_user, data, chat_instance, bot=None, **kwargs):
|
||||
# Required
|
||||
self.id = id
|
||||
self.from_user = from_user
|
||||
self.data = data
|
||||
self.chat_instance = chat_instance
|
||||
# Optionals
|
||||
self.message = kwargs.get('message')
|
||||
self.inline_message_id = kwargs.get('inline_message_id', '')
|
||||
self.game_short_name = kwargs.get('game_short_name')
|
||||
|
||||
self.bot = bot
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ class InlineKeyboardButton(TelegramObject):
|
|||
callback_data (str):
|
||||
switch_inline_query (str):
|
||||
switch_inline_query_current_chat (Optional[str]):
|
||||
callback_game (Optional[:class:`telegram.CallbackGame`]):
|
||||
|
||||
Args:
|
||||
text (str):
|
||||
|
@ -41,6 +42,7 @@ class InlineKeyboardButton(TelegramObject):
|
|||
callback_data (Optional[str]):
|
||||
switch_inline_query (Optional[str]):
|
||||
switch_inline_query_current_chat (Optional[str]):
|
||||
callback_game (Optional[:class:`telegram.CallbackGame`]):
|
||||
|
||||
"""
|
||||
|
||||
|
@ -53,6 +55,7 @@ class InlineKeyboardButton(TelegramObject):
|
|||
self.callback_data = kwargs.get('callback_data')
|
||||
self.switch_inline_query = kwargs.get('switch_inline_query')
|
||||
self.switch_inline_query_current_chat = kwargs.get('switch_inline_query_current_chat')
|
||||
self.callback_game = kwargs.get('callback_game')
|
||||
|
||||
@staticmethod
|
||||
def de_json(data, bot):
|
||||
|
|
Loading…
Add table
Reference in a new issue