Open b5414 opened 1 year ago
I want to get video file to my С:\PROJECT\download folder, i.e. С:\PROJECT\download\video.mp4
С:\PROJECT\download
С:\PROJECT\download\video.mp4
Issue with: bot.downloadFile()
bot.downloadFile()
bot.downloadFile(msg.video.file_id, './download/'); // Expected filePath here
ps I picked up './download/' from this issue
'./download/'
response = ENOENT: no such file or directory, open 'С:\PROJECT\download\С:\PROJECT\src\localBotApiServer\data\123123~AAAAAA\videos\file_1.mp4'
ENOENT: no such file or directory, open 'С:\PROJECT\download\С:\PROJECT\src\localBotApiServer\data\123123~AAAAAA\videos\file_1.mp4'
С:\PROJECT\src\localBotApiServer has telegram-bot-api.exe inside
С:\PROJECT\src\localBotApiServer
telegram-bot-api.exe
Seems so "LocalTgBotApi" server respond with Full file path, but this lib combine and think this is just a simple file name
telegram-bot-api.exe --local --api-id=ID --api-hash=HASH --http-stat-port 8090
bot.getMe()
response
const token = 'tokentoken'; const baseApiUrl = 'http://0.0.0.0:8081'; // cmd > ipconfig const bot = new TelegramBot(token, {polling: true, baseApiUrl}); bot.on('message', async(msg)=>{ const response = await bot.downloadFile(msg?.video?.file_id, './download/').catch((e)=>e.message); console.log('response', response); });
Actually
bot.downloadFile(msg?.video?.file_id, '')
is working, but it saving files in LocalTgBotApi's folder: С:\PROJECT\src\localBotApiServer\data\123123~AAAAAA\videos\file_1.mp4
С:\PROJECT\src\localBotApiServer\data\123123~AAAAAA\videos\file_1.mp4
ps I sure that:
bot.logOut()
ps It seemed to me that the file is full loaded after some time after a good response returned..
I want to get video file to my
С:\PROJECT\download
folder, i.e.С:\PROJECT\download\video.mp4
Issue with:
bot.downloadFile()
Expected Behavior
ps I picked up
'./download/'
from this issueActual Behavior
response =
ENOENT: no such file or directory, open 'С:\PROJECT\download\С:\PROJECT\src\localBotApiServer\data\123123~AAAAAA\videos\file_1.mp4'
С:\PROJECT\src\localBotApiServer
hastelegram-bot-api.exe
insideSeems so "LocalTgBotApi" server respond with Full file path, but this lib combine and think this is just a simple file name
Steps to reproduce the Behavior
telegram-bot-api.exe --local --api-id=ID --api-hash=HASH --http-stat-port 8090
Make sure all fine by usingbot.getMe()
response
Actually
is working, but it saving files in LocalTgBotApi's folder:
С:\PROJECT\src\localBotApiServer\data\123123~AAAAAA\videos\file_1.mp4
ps I sure that:
bot.logOut()
) and I receiving same response frombot.getMe()
as without baseApiUrlps It seemed to me that the file is full loaded after some time after a good response returned..