From 6b4beb3bbea7ff6592e04ad0d32edf21c64a1bb3 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Tue, 16 May 2017 17:35:53 +0000 Subject: [PATCH] better 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 | 2 +- commands/random/horoscope.js | 2 +- commands/random/meme.js | 2 +- commands/random/soundboard.js | 2 +- commands/random/spam.js | 2 +- commands/random/strawpoll.js | 2 +- commands/random/today.js | 2 +- commands/random/wouldyourather.js | 2 +- commands/randomimg/cat.js | 4 ++-- commands/randomimg/dog.js | 4 ++-- commands/randomimg/xiaopai.js | 2 +- commands/randomimg/xkcd.js | 6 +++--- commands/search/anime.js | 2 +- commands/search/botinfo.js | 2 +- commands/search/define.js | 2 +- commands/search/forecast.js | 2 +- commands/search/google.js | 2 +- commands/search/imdb.js | 2 +- commands/search/konachan.js | 4 ++-- commands/search/manga.js | 2 +- commands/search/map.js | 4 ++-- commands/search/neopet.js | 2 +- commands/search/osu.js | 2 +- commands/search/soundcloud.js | 2 +- commands/search/urban.js | 2 +- commands/search/wattpad.js | 2 +- 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 +- 49 files changed, 67 insertions(+), 67 deletions(-) diff --git a/commands/avataredit/3000years.js b/commands/avataredit/3000years.js index 7555e5ac..216aae76 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(err.message)); + .catch(err => msg.say(`${err.name}: ${err.message}`)); } catch (err) { - return msg.say(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/avataredit/beautiful.js b/commands/avataredit/beautiful.js index d14e4be8..6060094d 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(err.message)); + .catch(err => msg.say(`${err.name}: ${err.message}`)); } catch (err) { - return msg.say(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/avataredit/bobross.js b/commands/avataredit/bobross.js index d5016c8e..4e00ff0c 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(err.message)); + .catch(err => msg.say(`${err.name}: ${err.message}`)); } catch (err) { - return msg.say(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/avataredit/card.js b/commands/avataredit/card.js index 4b5bd990..6ba82d09 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(err.message)); + .catch(err => msg.say(`${err.name}: ${err.message}`)); } catch (err) { - return msg.say(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/avataredit/greyscale.js b/commands/avataredit/greyscale.js index 1e40bf5d..f1883366 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(err.message)); + .catch(err => msg.say(`${err.name}: ${err.message}`)); } catch (err) { - return msg.say(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/avataredit/invert.js b/commands/avataredit/invert.js index b7865e56..48457123 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(err.message)); + .catch(err => msg.say(`${err.name}: ${err.message}`)); } catch (err) { - return msg.say(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/avataredit/rip.js b/commands/avataredit/rip.js index 0917523d..2a2477ec 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(err.message)); + .catch(err => msg.say(`${err.name}: ${err.message}`)); } catch (err) { - return msg.say(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/avataredit/simba.js b/commands/avataredit/simba.js index 097f3e1e..c6df9941 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(err.message)); + .catch(err => msg.say(`${err.name}: ${err.message}`)); } catch (err) { - return msg.say(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/avataredit/steamcard.js b/commands/avataredit/steamcard.js index d61f3503..afdd18c3 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(err.message)); + .catch(err => msg.say(`${err.name}: ${err.message}`)); } catch (err) { - return msg.say(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/avataredit/triggered.js b/commands/avataredit/triggered.js index eaf45c15..01e8ffd5 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(err.message)); + .catch(err => msg.say(`${err.name}: ${err.message}`)); } catch (err) { - return msg.say(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/avataredit/wanted.js b/commands/avataredit/wanted.js index b13b2923..ed6027ca 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(err.message)); + .catch(err => msg.say(`${err.name}: ${err.message}`)); } catch (err) { - return msg.say(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/games/quiz.js b/commands/games/quiz.js index d2571160..63fa9023 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(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/moderation/ban.js b/commands/moderation/ban.js index 71d605ba..6173755a 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(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/moderation/kick.js b/commands/moderation/kick.js index 7cdd1b52..cf4b9898 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(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/moderation/lockdown.js b/commands/moderation/lockdown.js index 12f6b2be..e3f25e63 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(err.message); + return msg.say(`${err.name}: ${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(err.message); + return msg.say(`${err.name}: ${err.message}`); } } } diff --git a/commands/moderation/softban.js b/commands/moderation/softban.js index c9cba03a..26b1d02b 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(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/moderation/unban.js b/commands/moderation/unban.js index c18c9d8e..4bf3cb9b 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(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/numedit/currency.js b/commands/numedit/currency.js index 6307334e..14bea4b3 100644 --- a/commands/numedit/currency.js +++ b/commands/numedit/currency.js @@ -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(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/random/horoscope.js b/commands/random/horoscope.js index 7e054955..df86a1a4 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(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/random/meme.js b/commands/random/meme.js index 5d20cf2b..62ba38a4 100644 --- a/commands/random/meme.js +++ b/commands/random/meme.js @@ -42,6 +42,6 @@ module.exports = class MemeCommand extends Command { return msg.say('This Command requires the `Attach Files` Permission.'); const { type, top, bottom } = args; return msg.say({ files: [`https://memegen.link/${type}/${top}/${bottom}.jpg`] }) - .catch(() => msg.say('An Error Occurred while sending the image.')); + .catch(err => msg.say(`${err.name}: ${err.message}`)); } }; diff --git a/commands/random/soundboard.js b/commands/random/soundboard.js index ed31b553..b550b41f 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(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/random/spam.js b/commands/random/spam.js index a6224cfd..ccbac13c 100644 --- a/commands/random/spam.js +++ b/commands/random/spam.js @@ -16,6 +16,6 @@ module.exports = class SpamCommand extends Command { if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES')) return msg.say('This Command requires the `Attach Files` Permission.'); return msg.say({ files: [path.join(__dirname, '..', '..', 'assets', 'images', 'spam.png')] }) - .catch(() => msg.say('An Error Occurred while sending the image.')); + .catch(err => msg.say(`${err.name}: ${err.message}`)); } }; diff --git a/commands/random/strawpoll.js b/commands/random/strawpoll.js index 251cc464..acf28353 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(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/random/today.js b/commands/random/today.js index e71e323a..095315df 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(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/random/wouldyourather.js b/commands/random/wouldyourather.js index 7c3356f6..ba32a163 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(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/randomimg/cat.js b/commands/randomimg/cat.js index b04fcd74..8e12f55c 100644 --- a/commands/randomimg/cat.js +++ b/commands/randomimg/cat.js @@ -20,9 +20,9 @@ module.exports = class CatCommand extends Command { const { body } = await snekfetch .get('http://random.cat/meow'); return msg.say({ files: [body.file] }) - .catch(() => msg.say('An Error Occurred while sending the image.')); + .catch(err => msg.say(`${err.name}: ${err.message}`)); } catch (err) { - return msg.say(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/randomimg/dog.js b/commands/randomimg/dog.js index 348c0a18..72464059 100644 --- a/commands/randomimg/dog.js +++ b/commands/randomimg/dog.js @@ -19,9 +19,9 @@ module.exports = class DogCommand extends Command { const { body } = await snekfetch .get('https://random.dog/woof.json'); return msg.say({ files: [body.url] }) - .catch(() => msg.say('An Error Occurred while sending the image.')); + .catch(err => msg.say(`${err.name}: ${err.message}`)); } catch (err) { - return msg.say(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/randomimg/xiaopai.js b/commands/randomimg/xiaopai.js index 29f54a91..5053302a 100644 --- a/commands/randomimg/xiaopai.js +++ b/commands/randomimg/xiaopai.js @@ -18,6 +18,6 @@ module.exports = class XiaoCommand extends Command { return msg.say('This Command requires the `Attach Files` Permission.'); const xiao = Math.floor(Math.random() * 10) + 1; return msg.say({ files: [path.join(__dirname, '..', '..', 'assets', 'images', `xiaopai${xiao}.png`)] }) - .catch(() => msg.say('An Error Occurred while sending the image.')); + .catch(err => msg.say(`${err.name}: ${err.message}`)); } }; diff --git a/commands/randomimg/xkcd.js b/commands/randomimg/xkcd.js index 5c8c7fe8..a70d4307 100644 --- a/commands/randomimg/xkcd.js +++ b/commands/randomimg/xkcd.js @@ -32,16 +32,16 @@ module.exports = class XKCDCommand extends Command { const current = await snekfetch .get('https://xkcd.com/info.0.json'); if (type === 'today') return msg.say({ files: [current.body.img] }) - .catch(() => msg.say('An Error Occurred while sending the image.')); + .catch(err => msg.say(`${err.name}: ${err.message}`)); else { const random = Math.floor(Math.random() * current.body.num) + 1; const { body } = await snekfetch .get(`https://xkcd.com/${random}/info.0.json`); return msg.say({ files: [body.img] }) - .catch(() => msg.say('An Error Occurred while sending the image.')); + .catch(err => msg.say(`${err.name}: ${err.message}`)); } } catch (err) { - return msg.say(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/search/anime.js b/commands/search/anime.js index 83e41398..dcb9d814 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(err.message); + return msg.say('Error: No Results.'); } } }; diff --git a/commands/search/botinfo.js b/commands/search/botinfo.js index a56ed454..e652be35 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(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/search/define.js b/commands/search/define.js index d05db9ee..fe6ead39 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(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/search/forecast.js b/commands/search/forecast.js index 922b63f1..cdbc2969 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(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/search/google.js b/commands/search/google.js index 2c2c5a45..bcce2ead 100644 --- a/commands/search/google.js +++ b/commands/search/google.js @@ -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(err.message); + return message.edit(`${err.name}: ${err.message}`); } } }; diff --git a/commands/search/imdb.js b/commands/search/imdb.js index 7a5ae675..3f06fc9e 100644 --- a/commands/search/imdb.js +++ b/commands/search/imdb.js @@ -54,7 +54,7 @@ module.exports = class IMDBCommand extends Command { body.Actors); return msg.embed(embed); } catch (err) { - return msg.say(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/search/konachan.js b/commands/search/konachan.js index ab200a66..3aa3ddb1 100644 --- a/commands/search/konachan.js +++ b/commands/search/konachan.js @@ -34,9 +34,9 @@ module.exports = class KonachanCommand extends Command { }); if (!body.length) throw new Error('No Results.'); 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 => msg.say(`${err.name}: ${err.message}`)); } catch (err) { - return msg.say(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/search/manga.js b/commands/search/manga.js index 56ff7a66..7fb98d73 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(err.message); + return msg.say('Error: No Results.'); } } }; diff --git a/commands/search/map.js b/commands/search/map.js index cee2102c..448fa379 100644 --- a/commands/search/map.js +++ b/commands/search/map.js @@ -45,9 +45,9 @@ module.exports = class MapCommand extends Command { key: GOOGLE_KEY }); return msg.say({ files: [{ attachment: body, name: 'map.png' }] }) - .catch(() => msg.say('An Error Occurred while sending the image.')); + .catch(err => msg.say(`${err.name}: ${err.message}`)); } catch (err) { - return msg.say(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/search/neopet.js b/commands/search/neopet.js index fa60bb48..3472203d 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(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/search/osu.js b/commands/search/osu.js index 47b996da..9a3000b9 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(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/search/soundcloud.js b/commands/search/soundcloud.js index bb592168..c59e8630 100644 --- a/commands/search/soundcloud.js +++ b/commands/search/soundcloud.js @@ -51,7 +51,7 @@ module.exports = class SoundCloudCommand extends Command { body[0].favoritings_count, true); return msg.embed(embed); } catch (err) { - return msg.say(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/search/urban.js b/commands/search/urban.js index 3c4f0fca..52941cc2 100644 --- a/commands/search/urban.js +++ b/commands/search/urban.js @@ -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(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/search/wattpad.js b/commands/search/wattpad.js index 3e53baa6..e71cb68c 100644 --- a/commands/search/wattpad.js +++ b/commands/search/wattpad.js @@ -54,7 +54,7 @@ module.exports = class WattpadCommand extends Command { body.stories[0].commentCount, true); return msg.embed(embed); } catch (err) { - return msg.say(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/search/weather.js b/commands/search/weather.js index 52fa12b3..797e6054 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(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/search/wikipedia.js b/commands/search/wikipedia.js index 078d6385..ee6b1050 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(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/search/youtube.js b/commands/search/youtube.js index 1e921f48..31414469 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(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/search/yugioh.js b/commands/search/yugioh.js index 62d0f69f..4ffeb7b5 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(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/commands/textedit/webhook.js b/commands/textedit/webhook.js index 0c40eae3..56f38890 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(err.message); + return msg.say(`${err.name}: ${err.message}`); } } }; diff --git a/index.js b/index.js index 3ba869e5..05edcf7e 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(err.message) + return msg.reply(`${err.name}: ${`${err.name}: ${`${err.name}: ${err.message}`}`}`) .then(() => msg.channel.stopTyping()); } } else return;