mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-14 08:08:34 +02:00
better errors
This commit is contained in:
@@ -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}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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}`));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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}`));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user