MessageCommandDenied event is not listening.

Hi, i want to change cooldown/permission message, i found reporting-precondition-failure and i do listener like this;
import { Events, Listener, type MessageCommandDeniedPayload, type UserError } from '@sapphire/framework';

export class MessageCommandDenied extends Listener<typeof Events.MessageCommandDenied> {
public run(error: UserError, payload: MessageCommandDeniedPayload) {
console.log(error,payload);
}
}
import { Events, Listener, type MessageCommandDeniedPayload, type UserError } from '@sapphire/framework';

export class MessageCommandDenied extends Listener<typeof Events.MessageCommandDenied> {
public run(error: UserError, payload: MessageCommandDeniedPayload) {
console.log(error,payload);
}
}
cooldown still works but i want to reply message (event is not listening)
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
No description
Solution:
then you need to implement both listeners
Jump to solution
10 Replies
Favna
Favna3mo ago
you're using chat input commands, not message commands
Vrdons
VrdonsOP3mo ago
i want to do with chat input/message
Solution
Favna
Favna3mo ago
then you need to implement both listeners
Vrdons
VrdonsOP3mo ago
how?
Favna
Favna3mo ago
2 files, 2 listeners
Vrdons
VrdonsOP3mo ago
oh, i see
No description
Favna
Favna3mo ago
that's only the typescript type, the name of the file, or the name of the event in the options, defines which event the listener is for exactly
Vrdons
VrdonsOP3mo ago
so i do need like normal events? (constructor and super)
Favna
Favna3mo ago
you need 2 event listeners for 2 events I really cant put it any simpler way 2 files 2 names 2 listeners 2 implementations
Vrdons
VrdonsOP3mo ago
thanks

Did you find this page helpful?