You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here the problem is that the sendDocument accepts only "A file path, Stream or Buffer" while you are passing the contents of the file using fs.readFileSync, which reads the file and returns its content as a string and the sendDocument interpret it as a path. To pass the ".log" file you should use "fs.createReadStream("path_to_the_log_file");" or the directly the path of the file ".sendDocument(chatId, ${__dirname}/path_to_the_log_file)". There is still a problem using the Buffer because the fileType don't support the ".log" extention. For this reason you should enable manually the NTBA_FIX_350 inside env file as "NTBA_FIX_350=1". This would enable the library to auto-detect the file extension from the provided filename. So in your case you should be:
I have read:
I am using the latest version of the library.
Expected Behavior
Send tester.log file.
Actual Behavior
It gives me error
Unhandled rejection Error: ETELEGRAM: 400 Bad Request: invalid file HTTP URL specified: Wrong port number specified in the URL
Example
The text was updated successfully, but these errors were encountered: