D
D
Dozen Frozenballs2016-11-12 14:51:35
Python
Dozen Frozenballs, 2016-11-12 14:51:35

How to get the user's latitude and longitude through TelegramBot?

I request the user's coordinates through the button

button_geo = types.KeyboardButton (text="Your location", request_location=True)

I understand that I got its coordinates, but I can not pull out its data in any way, namely the width and longitude.
Tell me how to use the code to get the coordinates from the Message from the user.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
nllm, 2016-11-12
@nllm

The response is an object that has a location property ( https://core.telegram.org/bots/api#message)
Coordinates are passed to location ( https://core.telegram.org/bots/api#location)
In general, everything is the same as with texts

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question