From a43e196d6d47490d0b11420d84aa261542fc5f3d Mon Sep 17 00:00:00 2001 From: Alex Root Junior Date: Sun, 29 Jul 2018 03:08:33 +0300 Subject: [PATCH] Added the new field foursquare_type to the objects Venue, InlineQueryResultVenue and InputVenueMessageContent, and the parameter foursquare_type to the sendVenue method. --- aiogram/bot/bot.py | 3 +++ aiogram/types/inline_query_result.py | 14 ++++++++++---- aiogram/types/venue.py | 2 ++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/aiogram/bot/bot.py b/aiogram/bot/bot.py index de390ef7..7cc0606a 100644 --- a/aiogram/bot/bot.py +++ b/aiogram/bot/bot.py @@ -730,6 +730,7 @@ class Bot(BaseBot): latitude: base.Float, longitude: base.Float, title: base.String, address: base.String, foursquare_id: typing.Union[base.String, None] = None, + foursquare_type: typing.Union[base.String, None] = None, disable_notification: typing.Union[base.Boolean, None] = None, reply_to_message_id: typing.Union[base.Integer, None] = None, reply_markup: typing.Union[types.InlineKeyboardMarkup, @@ -753,6 +754,8 @@ class Bot(BaseBot): :type address: :obj:`base.String` :param foursquare_id: Foursquare identifier of the venue :type foursquare_id: :obj:`typing.Union[base.String, None]` + :param foursquare_type: Foursquare type of the venue, if known. + :type foursquare_type: :obj:`typing.Union[base.String, None]` :param disable_notification: Sends the message silently. Users will receive a notification with no sound. :type disable_notification: :obj:`typing.Union[base.Boolean, None]` :param reply_to_message_id: If the message is a reply, ID of the original message diff --git a/aiogram/types/inline_query_result.py b/aiogram/types/inline_query_result.py index 1c6c0007..a80352d7 100644 --- a/aiogram/types/inline_query_result.py +++ b/aiogram/types/inline_query_result.py @@ -405,6 +405,7 @@ class InlineQueryResultVenue(InlineQueryResult): thumb_url: base.String = fields.Field() thumb_width: base.Integer = fields.Field() thumb_height: base.Integer = fields.Field() + foursquare_type: base.String = fields.Field() def __init__(self, *, id: base.String, @@ -417,12 +418,14 @@ class InlineQueryResultVenue(InlineQueryResult): input_message_content: typing.Optional[InputMessageContent] = None, thumb_url: typing.Optional[base.String] = None, thumb_width: typing.Optional[base.Integer] = None, - thumb_height: typing.Optional[base.Integer] = None): + thumb_height: typing.Optional[base.Integer] = None, + foursquare_type: typing.Optional[base.String] = None): super(InlineQueryResultVenue, self).__init__(id=id, latitude=latitude, longitude=longitude, title=title, address=address, foursquare_id=foursquare_id, reply_markup=reply_markup, input_message_content=input_message_content, thumb_url=thumb_url, - thumb_width=thumb_width, thumb_height=thumb_height) + thumb_width=thumb_width, thumb_height=thumb_height, + foursquare_type=foursquare_type) class InlineQueryResultContact(InlineQueryResult): @@ -446,6 +449,7 @@ class InlineQueryResultContact(InlineQueryResult): thumb_url: base.String = fields.Field() thumb_width: base.Integer = fields.Field() thumb_height: base.Integer = fields.Field() + foursquare_type: base.String = fields.Field() def __init__(self, *, id: base.String, @@ -456,12 +460,14 @@ class InlineQueryResultContact(InlineQueryResult): input_message_content: typing.Optional[InputMessageContent] = None, thumb_url: typing.Optional[base.String] = None, thumb_width: typing.Optional[base.Integer] = None, - thumb_height: typing.Optional[base.Integer] = None): + thumb_height: typing.Optional[base.Integer] = None, + foursquare_type: typing.Optional[base.String] = None): super(InlineQueryResultContact, self).__init__(id=id, phone_number=phone_number, first_name=first_name, last_name=last_name, reply_markup=reply_markup, input_message_content=input_message_content, thumb_url=thumb_url, - thumb_width=thumb_width, thumb_height=thumb_height) + thumb_width=thumb_width, thumb_height=thumb_height, + foursquare_type=foursquare_type) class InlineQueryResultGame(InlineQueryResult): diff --git a/aiogram/types/venue.py b/aiogram/types/venue.py index 38f28cf9..1b420d57 100644 --- a/aiogram/types/venue.py +++ b/aiogram/types/venue.py @@ -13,3 +13,5 @@ class Venue(base.TelegramObject): title: base.String = fields.Field() address: base.String = fields.Field() foursquare_id: base.String = fields.Field() + foursquare_type: base.String = fields.Field() +