mirror of
https://github.com/yagop/node-telegram-bot-api
synced 2025-08-29 05:17:41 +00:00
util.isBuffer(data) is deprecated https://nodejs.org/api/util.html#util_util_isbuffer_object
This commit is contained in:
parent
7ebb1d120d
commit
b46ea1d9a6
@ -4,12 +4,12 @@ var TelegramBotWebHook = require('./telegramWebHook');
|
|||||||
var TelegramBotPolling = require('./telegramPolling');
|
var TelegramBotPolling = require('./telegramPolling');
|
||||||
var debug = require('debug')('node-telegram-bot-api');
|
var debug = require('debug')('node-telegram-bot-api');
|
||||||
var EventEmitter = require('events').EventEmitter;
|
var EventEmitter = require('events').EventEmitter;
|
||||||
|
var fileType = require('file-type');
|
||||||
var Promise = require('bluebird');
|
var Promise = require('bluebird');
|
||||||
var request = require('request');
|
var request = require('request');
|
||||||
var stream = require('stream');
|
var stream = require('stream');
|
||||||
var util = require('util');
|
var util = require('util');
|
||||||
var mime = require('mime');
|
var mime = require('mime');
|
||||||
var fileType = require('file-type');
|
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
var URL = require('url');
|
var URL = require('url');
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
@ -237,7 +237,7 @@ TelegramBot.prototype._formatSendData = function (type, data) {
|
|||||||
contentType: mime.lookup(fileName)
|
contentType: mime.lookup(fileName)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} else if(util.isBuffer(data)){
|
} else if (Buffer.isBuffer(data)) {
|
||||||
var filetype = fileType(data);
|
var filetype = fileType(data);
|
||||||
formData = {};
|
formData = {};
|
||||||
formData[type] = {
|
formData[type] = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user