lesterchan/telegram-bot

Receiving unexpected behavior while handling Telegram bot commands

Opened this issue · 1 comments

Hello and thank you for this nice software and tips. Following your instructions I am using AWS Lamba as webhook for all messages that comes to telegram bot.
However I got an issue. For some reason lambda function does not reply on command first time. Telegram user just has no answer. But it replies every next time on previous request.

I will give and example:

I put command 1. Result: no answer.
I put command 2. Result: answer on command 1.
I put command 3. Result: answer on command 2
I put command 4. Result: answer on command 3
and so on... what is going wrong?

For anyone who may encounter same situation. Replace the last line return processCommand; to return {statusCode: 200}; in index.js solve this problem for me. Still don't know why.