Skip to content

Commit

Permalink
fix: interaction command handler
Browse files Browse the repository at this point in the history
  • Loading branch information
xhyrom committed Feb 18, 2022
1 parent dea732c commit 71fb8f4
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/handlers/InteractionCommandHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ export async function InteractionCommandHandler(interaction: CommandInteraction
const client = interaction.client as GClient;

const command = Commands.get(interaction.commandName);
if (!command && client.options?.unknownCommandMessage)
return interaction.reply({
content: (await Util.getResponse('NOT_FOUND', interaction)),
ephemeral: true,
});
if (!command)
return client.options?.unknownCommandMessage ? interaction.reply({
content: (await Util.getResponse('NOT_FOUND', { client })),
}) : null;

if (command.cooldown) {
const cooldown = Handlers.cooldownHandler(interaction.user.id, command, cooldowns);
Expand Down

0 comments on commit 71fb8f4

Please sign in to comment.