Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

telegraf

Package Overview
Dependencies
Maintainers
1
Versions
241
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

telegraf - npm Package Compare versions

Comparing version 0.8.0 to 0.9.0

8

lib/telegraf.js

@@ -70,3 +70,3 @@ var debug = require('debug')('telegraf:core')

/**
* Generates filter `middleware`
* Generates `middleware` for handling provided event types.
*

@@ -77,3 +77,3 @@ * @param {string|string[]} eventTypes

*/
Telegraf.optional = function (eventTypes) {
Telegraf.handler = function (eventTypes) {
if (typeof eventTypes === 'string') {

@@ -231,3 +231,3 @@ eventTypes = [eventTypes]

var fns = [].slice.call(arguments, 1)
this.use(Telegraf.optional(eventTypes, Telegraf.compose(fns)))
this.use(Telegraf.handler(eventTypes, Telegraf.compose(fns)))
return this

@@ -253,3 +253,3 @@ }

var middleware = Telegraf.optional('text', function * (next) {
var middleware = Telegraf.handler('text', function * (next) {
var result = regex.exec(this.message.text)

@@ -256,0 +256,0 @@ if (result) {

{
"name": "telegraf",
"version": "0.8.0",
"version": "0.9.0",
"description": "📢 Modern Telegram bot framework",

@@ -5,0 +5,0 @@ "main": "lib/telegraf.js",

@@ -303,3 +303,3 @@ [![npm](https://img.shields.io/npm/l/telegraf.svg?style=flat-square)](https://www.npmjs.com/package/telegraf)

- [`Telegraf.optional(messageType, handler, [handler...])`](#optional)
- [`Telegraf.handler(messageType, handler, [handler...])`](#handler)
- [`Telegraf.compose(middleware)`](#compose)

@@ -343,4 +343,4 @@ - [`new Telegraf(token)`](#new)

<a name="optional"></a>
##### `Telegraf.optional(eventType, handler, [handler...])`
<a name="handler"></a>
##### `Telegraf.handler(eventType, handler, [handler...])`

@@ -347,0 +347,0 @@ Generates middleware for handling provided [event type](#events).

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc