0.0.4 • Published 7 years ago

telegraf-once v0.0.4

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

Telegraf

NPM Version Version node license

Telegraf-once

Wrapper for the original package Telegraf with the ability to subscribe to a single event

Installation

$ npm install telegraf-once --save

Documentation

Telegraf developer docs

Example

const Telegraf = require('telegraf-once')

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

app.command('start', (ctx) => {
  console.log('start', ctx.from)
  ctx.reply('Welcome!')
})

app.hears('hi', (ctx) => ctx.reply('Hey there!'))

app.on('sticker', (ctx) => ctx.reply('👍'))

app.startPolling()

There's some cool examples.