Skip to content
This repository was archived by the owner on Jul 9, 2024. It is now read-only.

ejnshtein/telegraf-session

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@telegraf/session

node

This is session middleware for @telegraf/core package.

Currently in development progress

Installation

$ npm install @telegraf/session

or using yarn:

$ yarn add @telegraf/session

Usage

import Telegraf from '@telegraf/core'
import session from '@telegraf/session'

const bot = new Telegraf('token')

bot.use(session())

bot.on('text', (ctx) => {
  ctx.session.counter = ctx.session.counter || 0
  ctx.session.counter++
  return ctx.reply(`Message counter:${ctx.session.counter}`)
})

bot.launch()

Coming soon...

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors