New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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.3.0 to 0.3.1

2

lib/app.js

@@ -368,2 +368,4 @@ var debug = require('debug')('telegraf:core')

}
} else if (typeof value === 'boolean') {
form.append(key, value.toString())
} else {

@@ -370,0 +372,0 @@ form.append(key, value)

5

package.json
{
"name": "telegraf",
"version": "0.3.0",
"version": "0.3.1",
"description": "Telegram bot framework",

@@ -13,2 +13,5 @@ "main": "lib/app.js",

"telegram",
"telegram bot",
"telegram api",
"telegram bot api",
"bot",

@@ -15,0 +18,0 @@ "bot framework"

@@ -18,3 +18,3 @@ # Telegraf

var app = Telegraf(process.env.BOT_TOKEN);
var app = new Telegraf(process.env.BOT_TOKEN);

@@ -29,3 +29,3 @@ // Look ma, middleware!

app.hears('/answer', sayYoMiddleware, function * () {
this.reply('*12*', { parse_mode: 'Markdown' })
this.reply('*42*', { parse_mode: 'Markdown' })
})

@@ -35,8 +35,3 @@

app.hears(/reverse (.+)/, function * () {
// Copy/Pasted from StackOverflow
function reverse (s) {
for (var i = s.length - 1, o = ''; i >= 0; o += s[i--]) { }
return o
}
this.reply(reverse(this.match[1]))
this.reply(this.match[1].split('').reverse().join(''))
})

@@ -47,3 +42,3 @@

There are some other examples on [examples](https://github.com/telegraf/telegraf/tree/master/examples).
There are some other [examples](https://github.com/telegraf/telegraf/tree/master/examples).

@@ -56,3 +51,3 @@ ## API

which are composed and executed in a stack-like manner upon request. Telegraf is similar to many
other middleware systems that you may have encountered such as Ruby's Rack, Connect, and so on -
other middleware systems that you may have encountered such as Koa, Ruby's Rack, Connect, and so on -
however a key design decision was made to provide high level "sugar" at the otherwise low-level

@@ -64,3 +59,3 @@ middleware layer. This improves interoperability, robustness, and makes writing middleware much

var Telegraf = require('telegraf')
var app = Telegraf('BOT TOKEN')
var app = new Telegraf(process.env.BOT_TOKEN)

@@ -89,3 +84,3 @@ app.on('text', function * (){

```js
var app = Telegraf('BOT TOKEN')
var app = new Telegraf(process.env.BOT_TOKEN)

@@ -124,3 +119,3 @@ // Logger middleware

```js
var app = Telegraf('BOT TOKEN')
var app = new Telegraf(process.env.BOT_TOKEN)

@@ -142,3 +137,3 @@ app.context.db = {

```js
var app = Telegraf('BOT TOKEN')
var app = new Telegraf(process.env.BOT_TOKEN)

@@ -206,3 +201,3 @@ app.use(function * (next) {

| --- | --- | --- |
| token | `String` | Bot Token |
| token | `String` | [Bot Token](https://core.telegram.org/bots#3-how-do-i-create-a-bot) |

@@ -645,3 +640,9 @@ * * *

```js
// Handle all messages
// Handle all messages except `inline_query`, `chosen_inline_result` and `callback_query`
app.on('sticker', function * () {
console.log(this.message)
this.reply('Cool sticker!')
})
app.on('message', function * () {

@@ -660,3 +661,3 @@ this.reply('Hey there!')

```js
var app = Telegraf('BOT TOKEN')
var app = new Telegraf(process.env.BOT_TOKEN)

@@ -663,0 +664,0 @@ app.on('text', function * (){

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