Answer the question
In order to leave comments, you need to log in
How to run Telegraf in AWS-Lambda?
I created in the API Gateway —> REST API —> I create a resource (I write Resource Path in it) —> I add a method (POST) —> Deploy
I created Lambda (nodejs ^ 14) and uploaded the code from the official Telegraf ^ 4.3 documentation example in an archive . Nothing works...
const Telegraf = require('telegraf')
const makeHandler = require('lambda-request-handler')
const token = '18**82**7**AA**PH**1S**Vn**1M**8p**A4**qb**Kc'
if (token === undefined) {
throw new Error('BOT_TOKEN must be provided!')
}
const bot = new Telegraf(token, {
telegram: { webhookReply: true }
})
bot.start((ctx) => ctx.reply('Hello'))
export const handler = makeHandler(
bot.webhookCallback('/<INVOKE_URL>')
)
Answer the question
In order to leave comments, you need to log in
All lambda logs are from cloud watch. In api gateway, you can run test directly from the configurator
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question