node-telegram-bot-api
Advanced tools
Comparing version 0.3.0 to 0.4.0
{ | ||
"name": "node-telegram-bot-api", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "Telegram Bot API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -80,3 +80,4 @@ var EventEmitter = require('events').EventEmitter; | ||
var self = this; | ||
if (req.url === '/bot' && req.method === 'POST') { | ||
var url = '/bot'+this.token; | ||
if (req.url === url && req.method === 'POST') { | ||
var fullBody = ''; | ||
@@ -89,7 +90,8 @@ req.on('data', function (chunk) { | ||
var data = JSON.parse(fullBody); | ||
self.emit('message', data); | ||
self.offset = data.update_id; | ||
self.emit('message', data.message); | ||
} catch (error) { | ||
console.error(error); | ||
} | ||
res.end('OK\n'); | ||
res.end('OK :P\n'); | ||
}); | ||
@@ -96,0 +98,0 @@ } else { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
91729
894