Code climate

experimental
yago 11 years ago
parent bc3927713a
commit 2598b1dce9
  1. 4
      src/telegram.js

@ -76,7 +76,7 @@ TelegramBot.prototype._configureWebHook = function (port, key, cert) {
TelegramBot.prototype._requestListener = function (req, res) {
var self = this;
if (req.url == '/bot' && req.method == 'POST') {
if (req.url === '/bot' && req.method === 'POST') {
var fullBody = '';
req.on('data', function (chunk) {
fullBody += chunk.toString();
@ -124,7 +124,7 @@ TelegramBot.prototype._request = function (path, options) {
return requestPromise(options)
.then(function (resp) {
if (resp[0].statusCode != 200) {
if (resp[0].statusCode !== 200) {
throw new Error(resp[0].statusCode+' '+resp[0].body);
}
var data = JSON.parse(resp[0].body);

Loading…
Cancel
Save