From 92f7c05015978719fbf6cc5289805f49e170df9f Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Tue, 16 May 2017 17:24:47 +0000 Subject: [PATCH] Improve Errors --- commands/avataredit/3000years.js | 4 ++-- commands/avataredit/beautiful.js | 4 ++-- commands/avataredit/bobross.js | 4 ++-- commands/avataredit/card.js | 4 ++-- commands/avataredit/greyscale.js | 4 ++-- commands/avataredit/invert.js | 4 ++-- commands/avataredit/rip.js | 4 ++-- commands/avataredit/simba.js | 4 ++-- commands/avataredit/steamcard.js | 4 ++-- commands/avataredit/triggered.js | 4 ++-- commands/avataredit/wanted.js | 4 ++-- commands/games/quiz.js | 2 +- commands/moderation/ban.js | 2 +- commands/moderation/kick.js | 2 +- commands/moderation/lockdown.js | 4 ++-- commands/moderation/softban.js | 2 +- commands/moderation/unban.js | 2 +- commands/numedit/currency.js | 4 ++-- commands/random/horoscope.js | 2 +- commands/random/soundboard.js | 2 +- commands/random/strawpoll.js | 2 +- commands/random/today.js | 2 +- commands/random/wouldyourather.js | 2 +- commands/randomimg/cat.js | 2 +- commands/randomimg/dog.js | 2 +- commands/randomimg/xkcd.js | 2 +- commands/search/anime.js | 2 +- commands/search/botinfo.js | 2 +- commands/search/define.js | 2 +- commands/search/forecast.js | 2 +- commands/search/google.js | 4 ++-- commands/search/imdb.js | 4 ++-- commands/search/konachan.js | 2 +- commands/search/manga.js | 2 +- commands/search/map.js | 2 +- commands/search/neopet.js | 2 +- commands/search/osu.js | 2 +- commands/search/soundcloud.js | 4 ++-- commands/search/urban.js | 4 ++-- commands/search/wattpad.js | 4 ++-- commands/search/weather.js | 2 +- commands/search/wikipedia.js | 2 +- commands/search/youtube.js | 2 +- commands/search/yugioh.js | 2 +- commands/textedit/webhook.js | 2 +- index.js | 2 +- 46 files changed, 64 insertions(+), 64 deletions(-) diff --git a/commands/avataredit/3000years.js b/commands/avataredit/3000years.js index d8351e2e..7555e5ac 100644 --- a/commands/avataredit/3000years.js +++ b/commands/avataredit/3000years.js @@ -45,9 +45,9 @@ module.exports = class YearsCommand extends Command { avatar.src = body; generate(); return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'az.png' }] }) - .catch(() => msg.say('An Error Occurred while sending the image.')); + .catch(() => msg.say(err.message)); } catch (err) { - return msg.say('An Error Occurred while creating the image.'); + return msg.say(err.message); } } }; diff --git a/commands/avataredit/beautiful.js b/commands/avataredit/beautiful.js index 19bd2045..d14e4be8 100644 --- a/commands/avataredit/beautiful.js +++ b/commands/avataredit/beautiful.js @@ -46,9 +46,9 @@ module.exports = class BeautifulCommand extends Command { avatar.src = body; generate(); return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'grunkle.png' }] }) - .catch(() => msg.say('An Error Occurred while sending the image.')); + .catch(() => msg.say(err.message)); } catch (err) { - return msg.say('An Error Occurred while creating the image.'); + return msg.say(err.message); } } }; diff --git a/commands/avataredit/bobross.js b/commands/avataredit/bobross.js index c4f892eb..d5016c8e 100644 --- a/commands/avataredit/bobross.js +++ b/commands/avataredit/bobross.js @@ -49,9 +49,9 @@ module.exports = class BobRossCommand extends Command { avatar.src = body; generate(); return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'ross.png' }] }) - .catch(() => msg.say('An Error Occurred while sending the image.')); + .catch(() => msg.say(err.message)); } catch (err) { - return msg.say('An Error Occurred while creating the image.'); + return msg.say(err.message); } } }; diff --git a/commands/avataredit/card.js b/commands/avataredit/card.js index c8633761..4b5bd990 100644 --- a/commands/avataredit/card.js +++ b/commands/avataredit/card.js @@ -68,9 +68,9 @@ module.exports = class CardCommand extends Command { avatar.src = body; generate(); return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'card.png' }] }) - .catch(() => msg.say('An Error Occurred while sending the image.')); + .catch(() => msg.say(err.message)); } catch (err) { - return msg.say('An Error Occurred while creating the image.'); + return msg.say(err.message); } } }; diff --git a/commands/avataredit/greyscale.js b/commands/avataredit/greyscale.js index 5c5eb05f..1e40bf5d 100644 --- a/commands/avataredit/greyscale.js +++ b/commands/avataredit/greyscale.js @@ -48,9 +48,9 @@ module.exports = class GreyscaleCommand extends Command { avatar.src = avatarImg.body; generate(); return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'greyscale.png' }] }) - .catch(() => msg.say('An Error Occurred while sending the image.')); + .catch(() => msg.say(err.message)); } catch (err) { - return msg.say('An Error Occurred while creating the image.'); + return msg.say(err.message); } } }; diff --git a/commands/avataredit/invert.js b/commands/avataredit/invert.js index fd114cec..b7865e56 100644 --- a/commands/avataredit/invert.js +++ b/commands/avataredit/invert.js @@ -46,9 +46,9 @@ module.exports = class InvertCommand extends Command { avatar.src = avatarImg.body; generate(); return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'invert.png' }] }) - .catch(() => msg.say('An Error Occurred while sending the image.')); + .catch(() => msg.say(err.message)); } catch (err) { - return msg.say('An Error Occurred while creating the image.'); + return msg.say(err.message); } } }; diff --git a/commands/avataredit/rip.js b/commands/avataredit/rip.js index d73c06c2..0917523d 100644 --- a/commands/avataredit/rip.js +++ b/commands/avataredit/rip.js @@ -54,9 +54,9 @@ module.exports = class RIPCommand extends Command { avatar.src = avatarImg.body; generate(); return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'rip.png' }] }) - .catch(() => msg.say('An Error Occurred while sending the image.')); + .catch(() => msg.say(err.message)); } catch (err) { - return msg.say('An Error Occurred while creating the image.'); + return msg.say(err.message); } } }; diff --git a/commands/avataredit/simba.js b/commands/avataredit/simba.js index bc871f04..097f3e1e 100644 --- a/commands/avataredit/simba.js +++ b/commands/avataredit/simba.js @@ -46,9 +46,9 @@ module.exports = class SimbaCommand extends Command { avatar.src = body; generate(); return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'simba.png' }] }) - .catch(() => msg.say('An Error Occurred while sending the image.')); + .catch(() => msg.say(err.message)); } catch (err) { - return msg.say('An Error Occurred while creating the image.'); + return msg.say(err.message); } } }; diff --git a/commands/avataredit/steamcard.js b/commands/avataredit/steamcard.js index b6e63171..d61f3503 100644 --- a/commands/avataredit/steamcard.js +++ b/commands/avataredit/steamcard.js @@ -50,9 +50,9 @@ module.exports = class SteamCardCommand extends Command { avatar.src = body; generate(); return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'card.png' }] }) - .catch(() => msg.say('An Error Occurred while sending the image.')); + .catch(() => msg.say(err.message)); } catch (err) { - return msg.say('An Error Occurred while creating the image.'); + return msg.say(err.message); } } }; diff --git a/commands/avataredit/triggered.js b/commands/avataredit/triggered.js index 49455480..eaf45c15 100644 --- a/commands/avataredit/triggered.js +++ b/commands/avataredit/triggered.js @@ -52,9 +52,9 @@ module.exports = class TriggeredCommand extends Command { avatar.src = body; generate(); return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'triggered.png' }] }) - .catch(() => msg.say('An Error Occurred while sending the image.')); + .catch(() => msg.say(err.message)); } catch (err) { - return msg.say('An Error Occurred while creating the image.'); + return msg.say(err.message); } } }; diff --git a/commands/avataredit/wanted.js b/commands/avataredit/wanted.js index 80dfc0c8..b13b2923 100644 --- a/commands/avataredit/wanted.js +++ b/commands/avataredit/wanted.js @@ -44,9 +44,9 @@ module.exports = class WantedCommand extends Command { avatar.src = body; generate(); return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'wanted.png' }] }) - .catch(() => msg.say('An Error Occurred while sending the image.')); + .catch(() => msg.say(err.message)); } catch (err) { - return msg.say('An Error Occurred while creating the image.'); + return msg.say(err.message); } } }; diff --git a/commands/games/quiz.js b/commands/games/quiz.js index 13b5ef3b..d2571160 100644 --- a/commands/games/quiz.js +++ b/commands/games/quiz.js @@ -45,7 +45,7 @@ module.exports = class QuizCommand extends Command { return msg.say(`Time! The correct answer is: ${answer}`); } } catch (err) { - return msg.say(`An Error Occurred: ${err}.`); + return msg.say(err.message); } } }; diff --git a/commands/moderation/ban.js b/commands/moderation/ban.js index b4a65984..71d605ba 100644 --- a/commands/moderation/ban.js +++ b/commands/moderation/ban.js @@ -67,7 +67,7 @@ module.exports = class BanCommand extends Command { `); return modlogs.send({ embed }); } catch (err) { - return msg.say('An Error Occurred.'); + return msg.say(err.message); } } }; diff --git a/commands/moderation/kick.js b/commands/moderation/kick.js index 5fb8a41a..7cdd1b52 100644 --- a/commands/moderation/kick.js +++ b/commands/moderation/kick.js @@ -66,7 +66,7 @@ module.exports = class KickCommand extends Command { `); return modlogs.send({ embed }); } catch (err) { - return msg.say('An Error Occurred.'); + return msg.say(err.message); } } }; diff --git a/commands/moderation/lockdown.js b/commands/moderation/lockdown.js index 9554aa1f..12f6b2be 100644 --- a/commands/moderation/lockdown.js +++ b/commands/moderation/lockdown.js @@ -40,14 +40,14 @@ module.exports = class LockdownCommand extends Command { Please use \`lockdown stop\` to end the lockdown. `); } catch (err) { - return msg.say('An Error Occurred.'); + return msg.say(err.message); } } else if (type === 'stop') { try { await msg.channel.overwritePermissions(msg.guild.defaultRole, { SEND_MESSAGES: true }); return msg.say('Lockdown Ended, users without Administrator can now post messages.'); } catch (err) { - return msg.say('An Error Occurred.'); + return msg.say(err.message); } } } diff --git a/commands/moderation/softban.js b/commands/moderation/softban.js index 353a5265..c9cba03a 100644 --- a/commands/moderation/softban.js +++ b/commands/moderation/softban.js @@ -70,7 +70,7 @@ module.exports = class SoftbanCommand extends Command { `); return modlogs.send({ embed }); } catch (err) { - return msg.say('An Error Occurred.'); + return msg.say(err.message); } } }; diff --git a/commands/moderation/unban.js b/commands/moderation/unban.js index dc1ab6f0..c18c9d8e 100644 --- a/commands/moderation/unban.js +++ b/commands/moderation/unban.js @@ -65,7 +65,7 @@ module.exports = class UnbanCommand extends Command { `); return modlogs.send({ embed }); } catch (err) { - return msg.say('An Error Occurred.'); + return msg.say(err.message); } } }; diff --git a/commands/numedit/currency.js b/commands/numedit/currency.js index 1399b57d..6307334e 100644 --- a/commands/numedit/currency.js +++ b/commands/numedit/currency.js @@ -45,7 +45,7 @@ module.exports = class CurrencyCommand extends Command { if (base === to) return msg.say(`Converting ${base} to ${to} is the same value, dummy.`); try { const { body } = await snekfetch - .get(`http://api.fixer.io/latest`) + .get('http://api.fixer.io/latest') .query({ base, symbols: to @@ -53,7 +53,7 @@ module.exports = class CurrencyCommand extends Command { const rate = body.rates[to]; return msg.say(`${amount} ${base} is ${amount * rate} ${to}.`); } catch (err) { - return msg.say('An Error Occurred.'); + return msg.say(err.message); } } }; diff --git a/commands/random/horoscope.js b/commands/random/horoscope.js index 29c33ce6..7e054955 100644 --- a/commands/random/horoscope.js +++ b/commands/random/horoscope.js @@ -48,7 +48,7 @@ module.exports = class HoroscopeCommand extends Command { body.date, true); return msg.embed(embed); } catch (err) { - return msg.say('An Error Occurred.'); + return msg.say(err.message); } } }; diff --git a/commands/random/soundboard.js b/commands/random/soundboard.js index 89d4ace1..ed31b553 100644 --- a/commands/random/soundboard.js +++ b/commands/random/soundboard.js @@ -49,7 +49,7 @@ module.exports = class SoundboardCommand extends Command { return null; }); } catch (err) { - return msg.say('An Error Occurred.'); + return msg.say(err.message); } } }; diff --git a/commands/random/strawpoll.js b/commands/random/strawpoll.js index cf6f1784..251cc464 100644 --- a/commands/random/strawpoll.js +++ b/commands/random/strawpoll.js @@ -46,7 +46,7 @@ module.exports = class StrawpollCommand extends Command { http://strawpoll.me/${body.id} `); } catch (err) { - return msg.say('An Error Occurred.'); + return msg.say(err.message); } } }; diff --git a/commands/random/today.js b/commands/random/today.js index 4711dc87..e71e323a 100644 --- a/commands/random/today.js +++ b/commands/random/today.js @@ -30,7 +30,7 @@ module.exports = class TodayCommand extends Command { .setDescription(`${event.year}: ${event.text}`); return msg.embed(embed); } catch (err) { - return msg.say('An Error Occurred.'); + return msg.say(err.message); } } }; diff --git a/commands/random/wouldyourather.js b/commands/random/wouldyourather.js index e13f9b3c..7c3356f6 100644 --- a/commands/random/wouldyourather.js +++ b/commands/random/wouldyourather.js @@ -27,7 +27,7 @@ module.exports = class WouldYouRatherCommand extends Command { .setDescription(`${body.choicea} OR ${body.choiceb}?`); return msg.embed(embed); } catch (err) { - return msg.say('An Error Occurred.'); + return msg.say(err.message); } } }; diff --git a/commands/randomimg/cat.js b/commands/randomimg/cat.js index f87e09fe..b04fcd74 100644 --- a/commands/randomimg/cat.js +++ b/commands/randomimg/cat.js @@ -22,7 +22,7 @@ module.exports = class CatCommand extends Command { return msg.say({ files: [body.file] }) .catch(() => msg.say('An Error Occurred while sending the image.')); } catch (err) { - return msg.say('An Error Occurred.'); + return msg.say(err.message); } } }; diff --git a/commands/randomimg/dog.js b/commands/randomimg/dog.js index 97af41d7..348c0a18 100644 --- a/commands/randomimg/dog.js +++ b/commands/randomimg/dog.js @@ -21,7 +21,7 @@ module.exports = class DogCommand extends Command { return msg.say({ files: [body.url] }) .catch(() => msg.say('An Error Occurred while sending the image.')); } catch (err) { - return msg.say('An Error Occurred.'); + return msg.say(err.message); } } }; diff --git a/commands/randomimg/xkcd.js b/commands/randomimg/xkcd.js index a9e31b44..5c8c7fe8 100644 --- a/commands/randomimg/xkcd.js +++ b/commands/randomimg/xkcd.js @@ -41,7 +41,7 @@ module.exports = class XKCDCommand extends Command { .catch(() => msg.say('An Error Occurred while sending the image.')); } } catch (err) { - return msg.say('An Error Occurred.'); + return msg.say(err.message); } } }; diff --git a/commands/search/anime.js b/commands/search/anime.js index 3d8d84f6..83e41398 100644 --- a/commands/search/anime.js +++ b/commands/search/anime.js @@ -57,7 +57,7 @@ module.exports = class AnimeCommand extends Command { anime.entry[0].end_date[0], true); return msg.embed(embed); } catch (err) { - return msg.say('An Error Occurred. There were most likely no results.'); + return msg.say(err.message); } } }; diff --git a/commands/search/botinfo.js b/commands/search/botinfo.js index ea3cf9df..a56ed454 100644 --- a/commands/search/botinfo.js +++ b/commands/search/botinfo.js @@ -43,7 +43,7 @@ module.exports = class BotSearchCommand extends Command { body.prefix, true); return msg.embed(embed); } catch (err) { - return msg.say('An Error Occurred. There were most likely no results.'); + return msg.say(err.message); } } }; diff --git a/commands/search/define.js b/commands/search/define.js index 63f564fb..d05db9ee 100644 --- a/commands/search/define.js +++ b/commands/search/define.js @@ -42,7 +42,7 @@ module.exports = class DefineCommand extends Command { .setDescription(body[0].text); return msg.embed(embed); } catch (err) { - return msg.say('An Error Occurred. There were most likely no results.'); + return msg.say(err.message); } } }; diff --git a/commands/search/forecast.js b/commands/search/forecast.js index aee00dc9..922b63f1 100644 --- a/commands/search/forecast.js +++ b/commands/search/forecast.js @@ -54,7 +54,7 @@ module.exports = class ForecastCommand extends Command { `**High:** ${forecasts[6].high}°F, **Low:** ${forecasts[6].low}°F, **Condition:** ${forecasts[6].text}`); return msg.embed(embed); } catch (err) { - return msg.say('An Error Occurred. There were most likely no results.'); + return msg.say(err.message); } } }; diff --git a/commands/search/google.js b/commands/search/google.js index 29d4bd88..2c2c5a45 100644 --- a/commands/search/google.js +++ b/commands/search/google.js @@ -25,7 +25,7 @@ module.exports = class GoogleCommand extends Command { const message = await msg.say('Searching...'); try { const { text } = await snekfetch - .get(`https://www.google.com/search`) + .get('https://www.google.com/search') .query({ q: query }); @@ -35,7 +35,7 @@ module.exports = class GoogleCommand extends Command { href = querystring.parse(href.replace('/url?', '')); return message.edit(href.q); } catch (err) { - return message.edit('An Error Occurred. There were most likely no results.'); + return message.edit(err.message); } } }; diff --git a/commands/search/imdb.js b/commands/search/imdb.js index dfbf34c0..7a5ae675 100644 --- a/commands/search/imdb.js +++ b/commands/search/imdb.js @@ -26,7 +26,7 @@ module.exports = class IMDBCommand extends Command { const { query } = args; try { const { body } = await snekfetch - .get(`http://www.omdbapi.com/`) + .get('http://www.omdbapi.com/') .query({ t: query, plot: 'full' @@ -54,7 +54,7 @@ module.exports = class IMDBCommand extends Command { body.Actors); return msg.embed(embed); } catch (err) { - return msg.say('An Error Occurred. There were most likely no results.'); + return msg.say(err.message); } } }; diff --git a/commands/search/konachan.js b/commands/search/konachan.js index ff84e0cf..ab200a66 100644 --- a/commands/search/konachan.js +++ b/commands/search/konachan.js @@ -36,7 +36,7 @@ module.exports = class KonachanCommand extends Command { return msg.say(query ? `Result for ${query}:` : 'Random Image:', { files: [`https:${body[0].file_url}`] }) .catch(() => msg.say('An Error Occurred while sending the image.')); } catch (err) { - return msg.say('An Error Occurred. There were most likely no results.'); + return msg.say(err.message); } } }; diff --git a/commands/search/manga.js b/commands/search/manga.js index 591f6aff..56ff7a66 100644 --- a/commands/search/manga.js +++ b/commands/search/manga.js @@ -57,7 +57,7 @@ module.exports = class MangaCommand extends Command { manga.entry[0].end_date[0], true); return msg.embed(embed); } catch (err) { - return msg.say('An Error Occurred. There were most likely no results.'); + return msg.say(err.message); } } }; diff --git a/commands/search/map.js b/commands/search/map.js index bdf057ea..cee2102c 100644 --- a/commands/search/map.js +++ b/commands/search/map.js @@ -47,7 +47,7 @@ module.exports = class MapCommand extends Command { return msg.say({ files: [{ attachment: body, name: 'map.png' }] }) .catch(() => msg.say('An Error Occurred while sending the image.')); } catch (err) { - return msg.say('An Error Occurred. There were most likely no results.'); + return msg.say(err.message); } } }; diff --git a/commands/search/neopet.js b/commands/search/neopet.js index 975c4630..fa60bb48 100644 --- a/commands/search/neopet.js +++ b/commands/search/neopet.js @@ -34,7 +34,7 @@ module.exports = class NeopetCommand extends Command { if (!link.includes('cp')) throw new Error('Invalid Pet Name.'); return msg.say(link); } catch (err) { - return msg.say('An Error Occurred. There were most likely no results.'); + return msg.say(err.message); } } }; diff --git a/commands/search/osu.js b/commands/search/osu.js index 96c7abe1..47b996da 100644 --- a/commands/search/osu.js +++ b/commands/search/osu.js @@ -64,7 +64,7 @@ module.exports = class OsuCommand extends Command { body[0].count_rank_a, true); return msg.embed(embed); } catch (err) { - return msg.say('An Error Occurred. There were most likely no results.'); + return msg.say(err.message); } } }; diff --git a/commands/search/soundcloud.js b/commands/search/soundcloud.js index 62577d54..bb592168 100644 --- a/commands/search/soundcloud.js +++ b/commands/search/soundcloud.js @@ -27,7 +27,7 @@ module.exports = class SoundCloudCommand extends Command { const { query } = args; try { const { body } = await snekfetch - .get(`https://api.soundcloud.com/tracks`) + .get('https://api.soundcloud.com/tracks') .query({ q: query, client_id: SOUNDCLOUD_KEY @@ -51,7 +51,7 @@ module.exports = class SoundCloudCommand extends Command { body[0].favoritings_count, true); return msg.embed(embed); } catch (err) { - return msg.say('An Error Occurred. There were most likely no results.'); + return msg.say(err.message); } } }; diff --git a/commands/search/urban.js b/commands/search/urban.js index 187582bb..3c4f0fca 100644 --- a/commands/search/urban.js +++ b/commands/search/urban.js @@ -26,7 +26,7 @@ module.exports = class UrbanCommand extends Command { const { query } = args; try { const { body } = await snekfetch - .get(`http://api.urbandictionary.com/v0/define`) + .get('http://api.urbandictionary.com/v0/define') .query({ term: query }); @@ -41,7 +41,7 @@ module.exports = class UrbanCommand extends Command { body.list[0].example.substr(0, 2000) || 'None'); return msg.embed(embed); } catch (err) { - return msg.say('An Error Occurred. There were most likely no results.'); + return msg.say(err.message); } } }; diff --git a/commands/search/wattpad.js b/commands/search/wattpad.js index f989f15a..3e53baa6 100644 --- a/commands/search/wattpad.js +++ b/commands/search/wattpad.js @@ -27,7 +27,7 @@ module.exports = class WattpadCommand extends Command { const { query } = args; try { const { body } = await snekfetch - .get(`https://api.wattpad.com:443/v4/stories`) + .get('https://api.wattpad.com:443/v4/stories') .query({ query, limit: 1 @@ -54,7 +54,7 @@ module.exports = class WattpadCommand extends Command { body.stories[0].commentCount, true); return msg.embed(embed); } catch (err) { - return msg.say('An Error Occurred. There were most likely no results.'); + return msg.say(err.message); } } }; diff --git a/commands/search/weather.js b/commands/search/weather.js index bce53b90..52fa12b3 100644 --- a/commands/search/weather.js +++ b/commands/search/weather.js @@ -63,7 +63,7 @@ module.exports = class WeatherCommand extends Command { body.query.results.channel.wind.speed, true); return msg.embed(embed); } catch (err) { - return msg.say('An Error Occurred. There were most likely no results.'); + return msg.say(err.message); } } }; diff --git a/commands/search/wikipedia.js b/commands/search/wikipedia.js index 2fe88606..078d6385 100644 --- a/commands/search/wikipedia.js +++ b/commands/search/wikipedia.js @@ -45,7 +45,7 @@ module.exports = class WikipediaCommand extends Command { .setDescription(body.query.pages[0].extract.substr(0, 2000).replace(/[\n]/g, '\n\n')); return msg.embed(embed); } catch (err) { - return msg.say('An Error Occurred. There were most likely no results.'); + return msg.say(err.message); } } }; diff --git a/commands/search/youtube.js b/commands/search/youtube.js index 4b9781ed..1e921f48 100644 --- a/commands/search/youtube.js +++ b/commands/search/youtube.js @@ -45,7 +45,7 @@ module.exports = class YouTubeCommand extends Command { .setThumbnail(body.items[0].snippet.thumbnails.default.url); return msg.embed(embed); } catch (err) { - return msg.say('An Error Occurred. There were most likely no results.'); + return msg.say(err.message); } } }; diff --git a/commands/search/yugioh.js b/commands/search/yugioh.js index baab7d78..62d0f69f 100644 --- a/commands/search/yugioh.js +++ b/commands/search/yugioh.js @@ -59,7 +59,7 @@ module.exports = class YuGiOhCommand extends Command { return msg.embed(embed); } } catch (err) { - return msg.say('An Error Occurred. There were most likely no results.'); + return msg.say(err.message); } } }; diff --git a/commands/textedit/webhook.js b/commands/textedit/webhook.js index 5cf266ac..0c40eae3 100644 --- a/commands/textedit/webhook.js +++ b/commands/textedit/webhook.js @@ -36,7 +36,7 @@ module.exports = class WebhookCommand extends Command { .send({ content }); return null; } catch (err) { - return msg.say('An Error Occurred.'); + return msg.say(err.message); } } }; diff --git a/index.js b/index.js index a8a53ba3..3ba869e5 100644 --- a/index.js +++ b/index.js @@ -79,7 +79,7 @@ client.on('message', async (msg) => { return msg.reply(response) .then(() => msg.channel.stopTyping()); } catch (err) { - return msg.reply('An Error Occurred.') + return msg.reply(err.message) .then(() => msg.channel.stopTyping()); } } else return;