title: Get geolocation via Telegram bot using inline
body: <p>If you use the bot via Inline in the Telegram, the bot can request the user's location, if this is enabled in the bot settings. The <a href="https://docs.telethon.dev/en/latest/modules/events.html#telethon.events.inlinequery.InlineQuery" rel="nofollow noreferrer">telethon.events.inlinequery.InlineQuery</a> class is responsible for getting geolocation.</p>
  <p>Here is the pseudo-code through which I <em>tried</em> to get geolocation in order to use latitude and longitude in the future:</p>
  <pre><code>from telethon import TelegramClient, events
  
  @client.on(events.InlineQuery)
  async def handler(event):
      location = event.geo
      builder = event.builder
  
      await event.answer([
          builder.article(&quot;Coordinates: &quot;, text=&quot;Long: &quot; + location.long + &quot;\nLat: &quot; + location.lat),
      ])
  </code></pre>
  <p>But I can't do anything. Constantly outputs <code>AttributeError: 'NoneType' object has no attribute 'lat'</code>.</p>
  <p>I would be grateful if you could help me in obtaining and <strong>using</strong> this data.</p>