From 61e8f8536818a2d98c81cbb92c764ec0d58ed989 Mon Sep 17 00:00:00 2001 From: kucherenkovova Date: Sat, 1 Jul 2017 08:56:01 +0300 Subject: [PATCH] src/telegram: Fix download file path on windows References: * BR: https://github.com/yagop/node-telegram-bot-api/issues/363 * PR: https://github.com/yagop/node-telegram-bot-api/pull/364 * PR-by: @kucherenkovova --- src/telegram.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/telegram.js b/src/telegram.js index 48f74e2..3d3b609 100644 --- a/src/telegram.js +++ b/src/telegram.js @@ -1050,7 +1050,7 @@ class TelegramBot extends EventEmitter { .then(fileURI => { const fileName = fileURI.slice(fileURI.lastIndexOf('/') + 1); // TODO: Ensure fileName doesn't contains slashes - const filePath = `${downloadDir}/${fileName}`; + const filePath = path.join(downloadDir, fileName); // properly handles errors and closes all streams return Promise