Alessandro
Alessandro

Reputation: 199

Telegram Inline Bot not call webhook

I've created new bot for Telegram. I've set /setinline in BotFather for my bot. I've added a webhook that is called when I send a message to bot but this webhook is not called if I write something in the bot chat without send any message.

Any idea how to solve?

Upvotes: 0

Views: 920

Answers (1)

nramirez
nramirez

Reputation: 5610

Yes, it does, probably you're inspecting the wrong param, it will call the same webhook, first remember you set the webhook by doing:

https://api.telegram.org/bot<BOT_TOKEN>/setWebhook?url=<YOUR_URL>

and like you mentioned, you need to enable /setinline through BotFather, then it will call your endpoint with a message with the following body:

{
    "query":"tex",
    "from": {
        "username":"user",
        "first_name":"firstname",
        "last_name":"lastname",
        "id": 8888888,
        "language_code":"en-US"},
    "id":"7777777",
    "offset":""
}

Remember it will call your endpoint on key-up you may receive a ton of request.

Upvotes: 0

Related Questions