Skip to content

plvxn/tgraf

 
 

Repository files navigation

@plvxn/tgraf

Modern Telegram Bot Framework for Node.js — fork of telegraf with Bot API 9.5 support.

Bot API npm

Why this fork

The original telegraf supports Bot API 7.1. This fork adds full support for Bot API 9.5: new methods, types, business accounts, gifts, stories, checklists, and more.

Installation

npm install @plvxn/tgraf

Quick start

const { Telegraf } = require('@plvxn/tgraf')
const { message } = require('@plvxn/tgraf/filters')

const bot = new Telegraf(process.env.BOT_TOKEN)

bot.start((ctx) => ctx.reply('Welcome'))
bot.help((ctx) => ctx.reply('Send me a message'))
bot.on(message('text'), (ctx) => ctx.reply(ctx.message.text))

bot.launch()

process.once('SIGINT', () => bot.stop('SIGINT'))
process.once('SIGTERM', () => bot.stop('SIGTERM'))

API compatibility

The API is compatible with telegraf. Use the original telegraf documentation — the API surface is the same. This fork adds new methods and types from Bot API 9.5.

Credits

Fork of telegraf by the Telegraf contributors.

License

MIT

Releases

Packages

Contributors

Languages