I'm working on a precondition that I wanna ignore on the ChatInputCommandDenied listener. The documentation suggests to a add information on the context in the Precondition
export class MyDummyPreconditions extends Precondition {
chatInputRun(
interaction: ChatInputCommandInteraction,
command: ChatInputCommand,
context: Precondition.Context
): Precondition.Result {
return this.error({ message: 'Ignored message', context: { silent: true } });
}
}
and check for it in ChatInputCommandDenied.
export class ChatInputCommandDeniedListener extends Listener<typeof Events.ChatInputCommandDenied> {
public async run({ context, message: content }: UserError, { interaction }: ChatInputCommandDeniedPayload) {
if (Reflect.get(Object(context), 'silent')) return;
if (interaction.deferred || interaction.replied) {
return interaction.editReply({
content,
allowedMentions: { users: [interaction.user.id], roles: [] }
});
}
return interaction.reply({
content,
allowedMentions: { users: [interaction.user.id], roles: [] },
ephemeral: true
});
}
}
That works but I realized that the interaction response will be:
The application did not respond
Is that expected or did I miss something?