bot.on('document', async (msg) => {
const userId = msg.from.id;
const { file_path } = await bot.getFile(msg.document.file_id);
const url = getDownloadUrl(file_path);
const source = getSourceFilePath(msg.from.username, msg.document.file_name);
const request = https.get(url, (res) => res.pipe(source));
...
.setProxy(proxy.socks(`${process.env.PROXY_IP}:${process.env.PROXY_PORT}`, Number(process.env.PROXY_SOCKS_VER)))
driver = new webdriver.Builder()
.withCapabilities(webdriver.Capabilities.firefox()
.setProxy(proxy.socks(`${process.env.PROXY_IP}:${process.env.PROXY_PORT}`, Number(process.env.PROXY_SOCKS_VER)))
.setAcceptInsecureCerts(true))
.build();