From b46ea1d9a66bbac3ea0dbc91b71d8010b4186b35 Mon Sep 17 00:00:00 2001 From: Yago Date: Sun, 3 Jan 2016 12:45:29 +0100 Subject: [PATCH] util.isBuffer(data) is deprecated https://nodejs.org/api/util.html#util_util_isbuffer_object --- src/telegram.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/telegram.js b/src/telegram.js index d7ed6dd..b9247d8 100644 --- a/src/telegram.js +++ b/src/telegram.js @@ -4,12 +4,12 @@ var TelegramBotWebHook = require('./telegramWebHook'); var TelegramBotPolling = require('./telegramPolling'); var debug = require('debug')('node-telegram-bot-api'); var EventEmitter = require('events').EventEmitter; +var fileType = require('file-type'); var Promise = require('bluebird'); var request = require('request'); var stream = require('stream'); var util = require('util'); var mime = require('mime'); -var fileType = require('file-type'); var path = require('path'); var URL = require('url'); var fs = require('fs'); @@ -237,7 +237,7 @@ TelegramBot.prototype._formatSendData = function (type, data) { contentType: mime.lookup(fileName) } }; - } else if(util.isBuffer(data)){ + } else if (Buffer.isBuffer(data)) { var filetype = fileType(data); formData = {}; formData[type] = {