When Sneaky buttons are enabled and refreshable location is processed, buttons can be added only on first edit (initial posting of message) because Telegram API method editMessageReplyMarkup is limited and can be used only for messages, that does not have any reply markup.
Sadly it is not working. On step 4 message already has some reply markup and Telegram refuses to update this message again, thus request fails. Quote from documentation:
Please note, that it is currently only possible to edit messages without reply_markup or with inline keyboards.
Solution
Instead of posting services links into buttons (eg Google maps, mapy.cz, etc) there will be one specific link leading to BetterLocation web, that will have unique reference to that specific message and service, eg https://better-location.palider.cz/exit/<chat-message-reference>/mapycz.
When user clicks on this button, it will open this website, which will load the newest available location for given message and then redirect user to target service location (eg Google Maps, mapy.cz, etc).
[!IMPORTANT]
Needs testing, if this solution is working even for mobile device (eg. Google maps should directly start navigation).
Problem
When Sneaky buttons are enabled and refreshable location is processed, buttons can be added only on first edit (initial posting of message) because Telegram API method
editMessageReplyMarkup
is limited and can be used only for messages, that does not have any reply markup.So this is would be best scenario:
Sadly it is not working. On step 4 message already has some reply markup and Telegram refuses to update this message again, thus request fails. Quote from documentation:
Solution
Instead of posting services links into buttons (eg Google maps, mapy.cz, etc) there will be one specific link leading to BetterLocation web, that will have unique reference to that specific message and service, eg
https://better-location.palider.cz/exit/<chat-message-reference>/mapycz
.When user clicks on this button, it will open this website, which will load the newest available location for given message and then redirect user to target service location (eg Google Maps, mapy.cz, etc).