fastify-telegraf

Fastify plugin to handle Telegraf webhook

MIT License

Downloads
65
Stars
6

fastify-telegraf

Fastify plugin to handle Telegraf's webhook with Typescript support, supports fastify 4.x.x

Install

npm i fastify-telegraf

// or

yarn add fastify-telegraf

Example

Given the following code:

const fastify = require('fastify')()
const { Telegraf } = require('telegraf')
const telegrafPlugin = require('fastify-telegraf')

const bot = new Telegraf(BOT_TOKEN)

fastify.register(telegrafPlugin, { bot, path: '/my-secret-path' })

fastify.listen(8000, (err) => {
  if (err) throw err
})

Fastify 3.x.x compatibility

Use [email protected]

License

Licensed under MIT