Skip to content

Commit 288d210

Browse files
committed
feat: reply with a message during development whenever a command was not registered
1 parent 377254e commit 288d210

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

src/command-handler.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,13 @@ export class CommandHandler {
134134
const command_name = match[1];
135135
if (!(command_name in this.text_commands)) {
136136
// unknown command
137+
138+
if (this.wheatley.devmode_enabled) {
139+
await message.reply({
140+
content: `Unknown text command: ${command_name}`,
141+
});
142+
}
143+
137144
return false;
138145
}
139146
let command_body = message.content.substring(match[0].length).trim();
@@ -186,7 +193,16 @@ export class CommandHandler {
186193

187194
private async handle_slash_comand(interaction: Discord.ChatInputCommandInteraction) {
188195
if (!(interaction.commandName in this.text_commands)) {
189-
// TODO: Unknown command
196+
// unknown command
197+
198+
if (this.wheatley.devmode_enabled) {
199+
await interaction.reply({
200+
content: `Unknown slash command: ${interaction.commandName}`,
201+
flags: Discord.MessageFlags.Ephemeral,
202+
});
203+
}
204+
205+
return;
190206
}
191207
let command = this.text_commands[interaction.commandName];
192208
let command_log_name = interaction.commandName;

0 commit comments

Comments
 (0)