How to get user's current location automatically in Telegram bot without requesting permission

I’m working on a Telegram bot project and need some help with location tracking.

I want to automatically detect where my users are located whenever they interact with my bot. Is there any way to grab their geographical position without having them manually share their location through the location button?

Basically I’m looking for a method that works behind the scenes - so when someone types a message to my bot, I can immediately know their coordinates or at least their city/country. I don’t want to bother users with location permission requests if possible.

Has anyone found a workaround for this? Maybe through IP address detection or some other Telegram API feature I’m missing? Any code examples would be really helpful too.

There’s no way to bypass Telegram’s privacy controls and grab location data automatically. I spent weeks trying to do this for a delivery bot - hit the same wall every time. Telegram blocks access to IP addresses and anything else that could reveal location without user consent. Third-party IP services don’t work either since all requests come from Telegram’s servers, not the user’s device. They built it this way on purpose - privacy is their whole thing. Your only real option is using the location request button and making it feel natural in your bot. Just explain upfront why you need their location so they actually want to share it.

nope, Telegram doesn’t automatically expose location data - that’s their whole security model. i tried building a geo-targeted news bot last year and hit the same wall. even proxy detection won’t work since all traffic goes through Telegram’s servers. just ask users for location permission upfront. most people don’t mind if you explain why you need it first.

Unfortunately, automatic location tracking isn’t feasible with Telegram’s privacy-centric architecture. Unlike typical web applications, Telegram does not provide bots with access to user IP addresses, as maintaining user anonymity is a priority for them. I encountered this limitation while developing a bot for weather updates and had to reconsider my strategy. The most effective approach remains utilizing the Telegram location sharing feature via KeyboardButton with request_location set to true. Although it requires user engagement, many are willing to share their location if they recognize the value. Crafting a seamless onboarding process can make the location request feel more intuitive and less intrusive.