
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
telegraf-aws
Advanced tools
Small lib to ease use of AWS Lambda with Telegraf in webhook mode
Small example of serverless Telegraf bot:
import Telegraf from 'telegraf'
import telegrafAws from 'telegraf-aws'
// Create telegraf instance for handle updates
const bot = new Telegraf(process.env.BOT_TOKEN, {
webhookReply: true
})
// Create webhook handler
const updateHandler = telegrafAws(bot, {
timeout: 1000 // Optional parameter, after timeout, empty response will be sent to AWS and function execution will be stopped
})
// Optional - set webhook url on start
bot.telegram.setWebhook(process.env.BOT_WEBHOOK_URL)
// Register bot commands
bot.command('help', ctx => ctx.reply('Try send a sticker!'))
bot.hears('hi', ctx => {
ctx.reply('Hey there!')
})
bot.hears(/buy/i, ctx => ctx.reply('Buy-buy!'))
bot.on('sticker', ctx => ctx.reply('👍'))
// Now use hello as your lambda function and done!
export const hello = updateHandler
FAQs
AWS Lambda helper for Telegraf bot framework
The npm package telegraf-aws receives a total of 4 weekly downloads. As such, telegraf-aws popularity was classified as not popular.
We found that telegraf-aws demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.