Answer the question
In order to leave comments, you need to log in
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
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)
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 questionAsk a Question
731 491 924 answers to any question