N
N
Nikita M.2021-07-14 14:49:05
Python
Nikita M., 2021-07-14 14:49:05

Is there a way to get updates from telegram bot geolocation broadcast?

Turned on the broadcast of geolocation to the telegram bot. The starting coordinates came, but no longer broadcasts. Is there a way to get coordinate updates? Thank you!
The question is purely theoretical. I didn’t see this in the documentation, but maybe the craftsmen found how to work with it

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mikhail Krostelev, 2021-07-14
@twistfire92

If you are using the telebot library, you can use
bot.middleware_handler with a parameter. update_types=['edited_message']
This code will handle changes to all messages. Moreover, the decorated function takes 2 arguments. Bot instance and message.

@bot.middleware_handler(update_types=['edited_message'])
def foo(bot_instanse, message):
    print(message)

There is not much documentation on this decorator, so you can rummage on the github in the source code of the library

R
robprane, 2021-07-14
@robprane

Now I checked, during the broadcast, messages with location. I won’t tell you exactly how - with a certain period or when changing location - documentation on this matter does not apply. But you just have to wait for new messages with location, each of them will be with a new update_id.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question