Skip to content
This repository has been archived by the owner on Oct 21, 2023. It is now read-only.

Command parameters parser middleware for Telegraf

Notifications You must be signed in to change notification settings

telegraf/telegraf-command-parts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚠️ This package is deprecated. Telegraf has a builtin command parser now. See v4.13.0 release notes.

Command Parts for Telegraf

This module is a plugin for the Telegraf Telegram Bot Framework.

It provides a middleware that splits a command in a Telegram text message to its parts. These parts are stored in ctx.state.command.

For example, if your text message is /start@yourbot Hello world!, the ctx.state.command holds the following properties:

  • text '/start@yourbot Hello world!'
  • command 'start'
  • bot 'yourbot'
  • args 'Hello world!'
  • splitArgs ['Hello', 'world!']

installation

To use this module in your Telegraf app, require it and pass it to app.use.

const commandParts = require('telegraf-command-parts');

app.use(commandParts());

About

Command parameters parser middleware for Telegraf

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •