Skip to content

Commit

Permalink
fix:pottential type error issue
Browse files Browse the repository at this point in the history
  • Loading branch information
RGHANILOO committed Apr 16, 2024
1 parent d739b7d commit 45ae388
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/listeners/interactionCreator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ import { Commands } from "../commandCenter/Commands";

export default (client: Client): void => {
client.on("interactionCreate", async (interaction: Interaction) => {
if (interaction.isCommand() || interaction.isContextMenuCommand()) {
if (interaction.isCommand()) {
await handleSlashCommand(client, interaction)
}
})
}
const handleSlashCommand = async (client: Client, interaction: CommandInteraction): Promise<void> => {
// this is where the slash command will be handled
const slashCommand = Commands.find(command => command.name === interaction.commandName);
if (!slashCommand) {
interaction.followUp({content: 'we havea problem'})
Expand Down

0 comments on commit 45ae388

Please sign in to comment.