diff --git a/bot.js b/bot.js index 309b8ba..81c7c04 100644 --- a/bot.js +++ b/bot.js @@ -134,6 +134,7 @@ function imgurRequest(subreddit, page_max) { if(json_data) { returnText = json_data.link; } } catch (error) { // Ignore the error and let the calling method handle the empty string. + client.channels.get('357365312620068874').send(error.message); } } } @@ -170,6 +171,7 @@ function subredditRequest(subreddit) { { // Ignore the error and continue. // continue; <-- last line in the loop... so does nothing. + client.channels.get('357365312620068874').send(error.message); } } } @@ -527,7 +529,6 @@ client.on('message', message => { //message.channel.send(error.name); //message.channel.send(error.message); client.channels.get('357365312620068874').send(error.message); - // If "Cannot read property 'link' of undefined" then the reddit doesn't exist. } break;