@@ -313,9 +313,47 @@ def sendVideo(self,
313313
314314 return Message .newFromJsonDict (data )
315315
316- def sendLocation (self ):
316+ def sendLocation (self ,
317+ chat_id ,
318+ latitude ,
319+ longitude ,
320+ reply_to_message_id = None ,
321+ reply_markup = None ):
322+ """Use this method to send point on the map.
323+
324+ Args:
325+ chat_id:
326+ Unique identifier for the message recipient — User or GroupChat id.
327+ latitude:
328+ Latitude of location.
329+ longitude:
330+ Longitude of location.
331+ reply_to_message_id:
332+ If the message is a reply, ID of the original message. [Optional]
333+ reply_markup:
334+ Additional interface options. A JSON-serialized object for a
335+ custom reply keyboard, instructions to hide keyboard or to force a
336+ reply from the user. [Optional]
337+ Returns:
338+ A telegram.Message instance representing the message posted.
339+ """
340+
317341 url = '%s/sendLocation' % (self .base_url )
318342
343+ data = {'chat_id' : chat_id ,
344+ 'latitude' : latitude ,
345+ 'longitude' : longitude }
346+
347+ if reply_to_message_id :
348+ data ['reply_to_message_id' ] = reply_to_message_id
349+ if reply_markup :
350+ data ['reply_markup' ] = reply_markup
351+
352+ json_data = self ._requestUrl (url , 'POST' , data = data )
353+ data = self ._parseAndCheckTelegram (json_data .content )
354+
355+ return Message .newFromJsonDict (data )
356+
319357 def sendChatAction (self ):
320358 url = '%s/sendChatAction' % (self .base_url )
321359
0 commit comments