mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2025-03-16 20:29:55 +01:00
Adding ChosenInlineResult #232
This commit is contained in:
parent
429ea92254
commit
e1de7220df
2 changed files with 9 additions and 3 deletions
|
@ -32,6 +32,7 @@ from .contact import Contact
|
|||
from .location import Location
|
||||
from .chataction import ChatAction
|
||||
from .userprofilephotos import UserProfilePhotos
|
||||
from .keyboardbutton import KeyboardButton
|
||||
from .replymarkup import ReplyMarkup
|
||||
from .replykeyboardmarkup import ReplyKeyboardMarkup
|
||||
from .replykeyboardhide import ReplyKeyboardHide
|
||||
|
@ -73,7 +74,6 @@ from .inputtextmessagecontent import InputTextMessageContent
|
|||
from .inputlocationmessagecontent import InputLocationMessageContent
|
||||
from .inputvenuemessagecontent import InputVenueMessageContent
|
||||
from .inputcontactmessagecontent import InputContactMessageContent
|
||||
from .keyboardbutton import KeyboardButton
|
||||
from .update import Update
|
||||
from .bot import Bot
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
This module contains a object that represents a Telegram ChosenInlineResult
|
||||
"""
|
||||
|
||||
from telegram import TelegramObject, User
|
||||
from telegram import TelegramObject, User, Location
|
||||
|
||||
|
||||
class ChosenInlineResult(TelegramObject):
|
||||
|
@ -45,11 +45,16 @@ class ChosenInlineResult(TelegramObject):
|
|||
def __init__(self,
|
||||
result_id,
|
||||
from_user,
|
||||
query):
|
||||
query,
|
||||
location=None,
|
||||
inline_message_id=None):
|
||||
# Required
|
||||
self.result_id = result_id
|
||||
self.from_user = from_user
|
||||
self.query = query
|
||||
# Optionals
|
||||
self.location = location
|
||||
self.inline_message_id = inline_message_id
|
||||
|
||||
@staticmethod
|
||||
def de_json(data):
|
||||
|
@ -64,6 +69,7 @@ class ChosenInlineResult(TelegramObject):
|
|||
return None
|
||||
data = data.copy()
|
||||
data['from_user'] = User.de_json(data.pop('from'))
|
||||
data['location'] = Location.de_json(data['location'])
|
||||
|
||||
return ChosenInlineResult(**data)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue