discord-js-error-helper
v1.0.0
Published
A helper package to provide clearer error messages for discord.js.
Downloads
2
Readme
discord-js-error-helper
A helper package to provide clearer error messages for discord.js.
Usage
const { validateCommand, MissingPermissionsError, InvalidArgumentTypeError, ChannelNotFoundError, UserNotFoundError, RoleNotFoundError, MessageTooLongError, CommandAlreadyExistsError, InvalidEmojiFormatError } = require('discord-js-error-helper');
try {
const command = 'createEmbed';
validateCommand(command);
} catch (error) {
console.error(error.message);
}
try {
// Simulate a missing permissions error
throw new MissingPermissionsError('MANAGE_CHANNELS');
} catch (error) {
console.error(error.message);
}
Installation
npm install discord-js-error-helper