2
0
mirror of https://github.com/yagop/node-telegram-bot-api synced 2025-08-22 18:07:16 +00:00

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
This commit is contained in:
kucherenkovova 2017-07-01 08:56:01 +03:00 committed by Gocho Mugo
parent 9a4298308e
commit 61e8f85368

View File

@ -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