mirror of
https://github.com/yagop/node-telegram-bot-api
synced 2025-09-05 00:35:21 +00:00
src/telegram: Emit 'info' on stream from TelegramBot#getFileStream()
This commit is contained in:
@@ -30,6 +30,13 @@ exports = module.exports = {
|
||||
* @return {Promise}
|
||||
*/
|
||||
isPollingMockServer,
|
||||
/**
|
||||
* Return true if the string is a URI to a file
|
||||
* on Telegram servers.
|
||||
* @param {String} uri
|
||||
* @return {Boolean}
|
||||
*/
|
||||
isTelegramFileURI,
|
||||
/**
|
||||
* Send a message to the webhook at the specified port and path.
|
||||
* @param {Number} port
|
||||
@@ -217,3 +224,8 @@ function handleRatelimit(bot, methodName, suite) {
|
||||
};
|
||||
return bot;
|
||||
}
|
||||
|
||||
|
||||
function isTelegramFileURI(uri) {
|
||||
return /https?:\/\/.*\/file\/bot.*\/.*/.test(uri);
|
||||
}
|
||||
|
Reference in New Issue
Block a user