mirror of
https://github.com/yagop/node-telegram-bot-api
synced 2025-08-29 13:27:44 +00:00
Bind getFile response in getFileLink
This commit is contained in:
parent
8a09f77327
commit
c5f97ce524
@ -515,16 +515,14 @@ TelegramBot.prototype.getFile = function(fileId) {
|
|||||||
* @see https://core.telegram.org/bots/api#getfile
|
* @see https://core.telegram.org/bots/api#getfile
|
||||||
*/
|
*/
|
||||||
TelegramBot.prototype.getFileLink = function(fileId) {
|
TelegramBot.prototype.getFileLink = function(fileId) {
|
||||||
|
return this.getFile(fileId)
|
||||||
var self = this;
|
.then(function (resp) {
|
||||||
return self.getFile(fileId).then(function (resp) {
|
|
||||||
return URL.format({
|
return URL.format({
|
||||||
protocol: 'https',
|
protocol: 'https',
|
||||||
host: 'api.telegram.org',
|
host: 'api.telegram.org',
|
||||||
pathname: '/file/bot' + self.token + '/' + resp.file_path
|
pathname: '/file/bot' + this.token + '/' + resp.file_path
|
||||||
});
|
});
|
||||||
});
|
}.bind(this));
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user