From 17f2a38e8dfcb90c2af7ecbaaaa40c49bb4d2f13 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Sun, 30 Aug 2020 16:05:53 +0200 Subject: [PATCH] better error message if bot is blocked Signed-off-by: loicbersier --- commands/fun/ytp.js | 1 + 1 file changed, 1 insertion(+) diff --git a/commands/fun/ytp.js b/commands/fun/ytp.js index e2f34808..cdf5ed0c 100644 --- a/commands/fun/ytp.js +++ b/commands/fun/ytp.js @@ -188,6 +188,7 @@ class ytpCommand extends Command { return downloader(url, options, `./asset/ytp/userVid/${message.id}.mp4`) .on('error', (err) => { 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 }); }) .on('end', async output => {