Using method getFile (https://core.telegram.org/bots/api#getfile) does not always return the same path. The link to files is not stored at database due to it's necessary to request every time. See: https://github.com/gilpanal/beatbytebot_api/blob/master/src/resolvers.js
getFile
Getting a file from Telegram without exposing Bot Secret Token in the client side. Example: https://gist.github.com/gilpanal/099ff5fc94366fbaabd5e2fbedc7c86f
For method fileUpload in helpers.js was required to add maxContentLength and maxBodyLength equal to Infinity
fileUpload
helpers.js
maxContentLength
maxBodyLength
Infinity
await axios.post(API_BOT + BOT_TOKEN + '/sendAudio', form, { headers: { 'Content-Type': `multipart/form-data; boundary=${form._boundary}` }, 'maxContentLength': Infinity, 'maxBodyLength': Infinity }).then(async (responseTelegram) => { uploadResponse = await handleResponseFromTelegram(responseTelegram, req.body.chat_id) }).catch((err) => { const error = err && err.response && err.response.data uploadResponse = error })
There was an error while loading. Please reload this page.