1.1.6 • Published 7 years ago

telegraf-query-parser v1.1.6

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

Query parser middleware for Telegraf

Installation

$ npm install telegraf-query-parser

Example

const Telegraf = require('telegraf')

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

bot.use(require('telegraf-query-parser'))

// When user sends */start?id=13881466*
bot.start(ctx => {
  console.log(ctx.query) // returns { 'id': '13881466' }
  ctx.reply(`You were invited by user ${ctx.query.id}`)
})

bot.startPolling() 

//TODO: Write examples of using query parser with inline keyboard

1.1.6

7 years ago

1.1.5

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago