Thank you. Working. How “Instant View” at 3.14?
Requesting Location in Telegram
Still getting a 400 with my location requests on Telegram.
Status Code
400
Body
{"ok":false,"error_code":400,"description":"Bad Request: chat not found"}
Data
{
"ok": false,
"error_code": 400,
"description": "Bad Request: chat not found"
}
My inputs seems right
Webhook URL
https://api.telegram.org/bot{SomeNumbers}:{RandomText}/sendMessage
HTTP Method
POST
Content Type
Raw Body
Body{
"chat_id": "{MyChatID-SomeRandomNumbersToo}",
"text": "Can i get your location please. Click on the button below",
"reply_markup": {
"keyboard": [
[{
"text": "Send Location",
"request_location": true
}]
]
}
}
Headers
Content-Type: application/json
Hi Art,
Sorry, I’m not sure what you are referring to with Instant View?
Hi Chimere,
The chat ID doesn’t seem to be valid. The ID should be the channel ID that has been captured by the bot when the user has spoken to it.
I seem to be having some issues with the response.
So according to the steps, the bot sends a text message and a button to ask for the user’s current location.
Issue #1: Before I can even press the button, the next message is already loaded. Ive added a filter to the next message, so it will only run if the responsecode is 200. With no succes. The next message is loaded directly.
Issue #2: This is the response I get:
Status Code
200
Body
{“ok”:true,“result”:{“message_id”:112,“from”:{“id”:325077223,“first_name”:“SOSI”,“username”:“Berger_bot”},“chat”:{“id”:224870002,“first_name”:“Hamza”,“last_name”:“Jap-Tjong”,“type”:“private”},“date”:1480509387,“text”:“Om de dichtsbijzijnde hersteller te vinden, heb ik uw locatie nodig. Druk op de knop om deze eenmalig toe te zenden”}}
Data
{
“ok”: true,
“result”: {
“message_id”: 112,
“from”: {
“id”: 325077223,
“first_name”: “SOSI”,
“username”: “Berger_bot”
},
“chat”: {
“id”: 224870002,
“first_name”: “Hamza”,
“last_name”: “Jap-Tjong”,
“type”: “private”
},
“date”: 1480509387,
“text”: “Om de dichtsbijzijnde hersteller te vinden, heb ik uw locatie nodig. Druk op de knop om deze eenmalig toe te zenden”
}
}
I don’t see any long/lat data
Did I do something wrong?
Thanks
Hamza
Hi Hamza,
The response to the webhook is only a server response and not a user message (clicking the button).
The user message will be a webhook sent to us from Telegram that needs to be captured using the Bot > New File trigger in a separate flow. Location data is handled using the New File trigger only.
Hopefully, this clears things up for you
Thanks Kellsey,
I got it working but now the button only stays for a brief second before disappearing not giving the user enough time to press it and get the location information prompt. It generally just carries on to the next flow without getting input from the user. Please help.
~Chimere
Hi Chimere,
The flow does not wait for the user to respond as it’s not a question to the user. You would need to set up another flow using the Bot > New File trigger to receive the location.
Hi Kellsey,
Still no bite, the application behaves the same way. I named my new Bot the same name as the webhook but they don’t seem to find each other theres some intuition missing somewhere and you guys have a lot of work to do. My client is vey angry and am considering using a programming library or learning the telegram api myself. My final word, help or forget it.
Hi Chimere,
You can install our Example, which is tested and working. You’ll need to add your bot token to the URL and you’ll need to make sure that you have a second flow using the Bot > New File trigger, which will receive the location once it’s sent
Hey Kellsey,
I tried the example, it wasn’t so different from my implementation. It did trigger as expected in the logs and i was able to use the shortcut button. However, what i’d like it to do is make the flow trigger on the second question. My first question which is also an introduction has a shortcut button I was also able to make the two buttons appear on the first question but this isn’t required.
Thank you for everything. Am still reading your docs and follow your videos but you guys still need a clear and concise tutorial beyond the articles on medium.
Hi Chimere,
If you wanted two questions followed by the location button, you would just need to add two question tasks to your flow and then send the location button as per the below.
The idea of the videos and medium tutorials is to give users a good starting point. They aren’t meant to be a complete solution because with bots being so highly customisable, no two bots will be the same.
We welcome suggestions for content for the video’s etc, though, so if there a feature you’d like covered, feel free to let us know your suggestion and we’ll see if it’s something that we can cover in one of our web casts
No errors. Do not complete the work inline keyboard. Bot - Catch-all does not catch the button press.
Hi Art,
In Telegrams doc’s it states:
Unlike with custom reply keyboards, pressing buttons on inline keyboards doesn't result in messages sent to the chat. Instead, inline keyboards support buttons that work behind the scenes: callback buttons, URL buttons and switch to inline buttons.
These types of buttons don’t work with our flows sorry.
Hello Kellsey,
can you pls explain the meaning \ use case of having Shortcuts in a Send Message, if you say the flow does not wait for the user to respond?
Thanks
Levon
Hi there. So how can I use this location after the user has pressed “Share location” and save it in Google Sheets for instance. Thanks.
Hi @amrbtc
To capture the returned location you’ll need another flow setup that uses a trigger for ‘New File’. The location will be available in the Metadata on that flow, e.g. {{new_file.metadata}}