bottender
bottender copied to clipboard
Not work in AWS Lambda
Hello. I try setup bot in AWS Lambda, but bot (Telegram) functions are not working.
Example:
module.exports = async function App( context ) {
const event = context.event;
console.log(event);
console.log(event.message.from);
console.log(event.message.chat);
await context.sendText( `@${event.message.from.username} - Hi!` );
Lambda log:
In local that works well. What could be the reason?
Hi @ange007
I have tested some cases and here are some of my findings. Let me know if you have any further question or information 😅
tldr:
The AWS Lambda functions seem to have problem sending requests to the webhook recently. Since the problem had never occurred before when I developed using Lambda + Bottender, I may wait for a few days and check if the problem is still occurring.
Test cases:
- AWS + Telegram
- AWS + LINE
- AWS + Messenger
- GCP + Telegram
- GCP + LINE
- GCP + Messenger
Result:
AWS cases all fail to send text to user. GCP cases all work as expected.
Detailed failed cases:
The AWS Lambda functions now can't send request to the webhook correctly.
Sometimes there's no error message shown and sometimes there're some types of error message will display randomly (See screenshot 1 & 2).
However, when you trigger the function multiples times in a short period, the AWS Lambda functions will actually send the first few requests to the webhook successfully but fail to send the latter ones (See screenshot 3).
Screenshot 1
Screenshot 2
Screenshot 3
Hi. Any idea? Perhaps need add connection settings for the bot? With the ability to change parameters? For fix connection errors?
Has anyone come across this? It doesn’t work for me.
Quick note @ange007. Have you tried setting sync: true
for the bot's config in bottender.config? I am only testing locally at the moment but it will immediately return without that setting.
I have same issue but message is different.