better error message if bot is blocked

Signed-off-by: loicbersier <loic.bersier1@gmail.com>
This commit is contained in:
loicbersier 2020-08-30 16:05:53 +02:00
parent 3cff522147
commit 17f2a38e8d

View file

@ -188,6 +188,7 @@ class ytpCommand extends Command {
return downloader(url, options, `./asset/ytp/userVid/${message.id}.mp4`) return downloader(url, options, `./asset/ytp/userVid/${message.id}.mp4`)
.on('error', (err) => { .on('error', (err) => {
loadingmsg.delete(); loadingmsg.delete();
if (err.includes('HTTP Error 429: Too Many Requests')) return message.channel.send('`HTTP Error 429: Too Many Requests.`\nThe website you tried to download from probably has the bot blocked, you can try again with the `--proxy` option and hope it work.');
return message.channel.send(err, { code: true }); return message.channel.send(err, { code: true });
}) })
.on('end', async output => { .on('end', async output => {