mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2025-02-16 18:31:45 +01:00
small fix for game related parts
* bot.py fix copy paste error in url * callbackquery.py make data field optional * message.py introduce optional game field
This commit is contained in:
parent
bfb4c63d60
commit
8cab735342
3 changed files with 4 additions and 3 deletions
|
@ -776,7 +776,7 @@ class Bot(TelegramObject):
|
|||
:class:`telegram.TelegramError`
|
||||
|
||||
"""
|
||||
url = '{0}/sendMessage'.format(self.base_url)
|
||||
url = '{0}/sendGame'.format(self.base_url)
|
||||
|
||||
data = {'chat_id': chat_id, 'game_short_name': game_short_name}
|
||||
|
||||
|
|
|
@ -25,14 +25,14 @@ from telegram import TelegramObject, Message, User
|
|||
class CallbackQuery(TelegramObject):
|
||||
"""This object represents a Telegram CallbackQuery."""
|
||||
|
||||
def __init__(self, id, from_user, data, chat_instance, bot=None, **kwargs):
|
||||
def __init__(self, id, from_user, 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.data = kwargs.get('data', '')
|
||||
self.inline_message_id = kwargs.get('inline_message_id', '')
|
||||
self.game_short_name = kwargs.get('game_short_name')
|
||||
|
||||
|
|
|
@ -123,6 +123,7 @@ class Message(TelegramObject):
|
|||
self.text = kwargs.get('text', '')
|
||||
self.entities = kwargs.get('entities', list())
|
||||
self.audio = kwargs.get('audio')
|
||||
self.game = kwargs.get('game')
|
||||
self.document = kwargs.get('document')
|
||||
self.photo = kwargs.get('photo')
|
||||
self.sticker = kwargs.get('sticker')
|
||||
|
|
Loading…
Add table
Reference in a new issue