messageCommandDenied preventing bot from booting
Hello, I'm using the basic messageCommandDenied code provided in the sapphire docs and it has been working up until today but upon booting up one of my bots I get the following error:
The code I use for this event is directly ripped from the docs here: https://www.sapphirejs.dev/docs/Guide/preconditions/reporting-precondition-failure
Sapphire Framework
Reporting precondition failure | Sapphire
When a precondition fails, it's usually important for the user to know why. For example, if they hit a cooldown or lack
6 Replies
This is due to an update in discordjs 14.16.1. add a typeguard in your code for it. Sapphire code and docs havent been update yet. Simply do something like
(message.channel as Exclude<Message['channel'], PartialGroupDMChannel>).send
Could you make a GH issue to the sapphiredev/website repository remarking this so I have a reminder on GitHub?
In the sapphire update that'll come in the coming weeks we'll provide an updated isTextBasedChannel
utility function (through @sapphire/discord.js-utilities which is a transient dep of sapphire framework) that checks for this.
https://github.com/sapphiredev/utilities/blob/fc35dd867f60ffe3298a9f7fdf790d84c3e353fa/packages/discord.js-utilities/src/lib/type-guards.ts#L158-L170Praise be the isTextBasedChannel utility function, savior of all my bots in the future!! Yeah I can make a GH issue, uno momento
GitHub
request: Update the reporting precondition failure page · Issue #27...
Is there an existing issue or pull request for this? I have searched the existing issues and pull requests Feature description https://www.sapphirejs.dev/docs/Guide/preconditions/reporting-precondi...
It works now, marking as solved, thanks!
Thanks!
sorry for typing on a solved post, but this would also need to be updated in the Typescript starter example as the example ping command would need this update