Vidyak
Vidyak

Reputation: 1

setting up an amazon webhook and a Lambda function with Telegram

I'm trying to link a telegram bot with a lambda function that bears a LLM. In order to do so, I've used a HTTP API gateway and a webhook. I've also linked my webhook to my telegram bot. My lambda function is able to write back to the telegram chat but for a reason i can't figure out, the webhook doesn't create any event when a message is sent on telegram.

What's the bug ? Why am I not able to get the messages in the Telegram chat using my webhook ?

I run the following post request : https://api.telegram.org/bot/getWebhookInfo and I get the following response:

{
    "ok": true,
    "result": {
        "url": "https://<ID>.execute-api.us-east-1.amazonaws.com",
        "has_custom_certificate": false,
        "pending_update_count": 10,
        "last_error_date": 1722012206,
        "last_error_message": "Wrong response from the webhook: 404 Not Found",
        "max_connections": 40,
        "ip_address": IP_ADDRESS
    }
}

Upvotes: 0

Views: 128

Answers (1)

shantanu
shantanu

Reputation: 1

Is there any specific reason that you are using API gateway? You can use Function URL available in Lambda. See the example here...

https://shantanuo.medium.com/telegram-bot-for-chatgpt-d23e25fde937

Upvotes: 0

Related Questions