ClicksCodes / haiku

Discord.JS Custom Client
2 stars 0 forks source link

Overwriting default error messages #7

Open PineaFan opened 2 years ago

PineaFan commented 2 years ago

The current message if you don't have permissions is a #FF0000 embed saying "You don't have permission to run this command", but this should be customisable with a colour, title, and message depending on the error

Also if possible, support for default colours such as "success" and "danger", which these errors will use when no colour is provided

Minion3665 commented 2 years ago

Would it be acceptable to have an onCommandError event similar to discord.py so you can handle errors yourself instead?

PineaFan commented 2 years ago

Yes that's fine

Minion3665 commented 2 years ago

Note: A fix to this should also handle the unhandledRejection event and stop the bot from crashing; e.g.

promise = new Promise((resolve, reject) => reject("There was a problem..."));

process.on('unhandledRejection', error => {
    console.log("We're saved!: " + error)
})

setTimeout(() => console.log("Here's something to keep the program running"), 10000)