This repository has been archived on 2026-03-27. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
bot/src/events/interactionCreate.ts
2022-12-30 12:15:49 +01:00

19 lines
630 B
TypeScript

import { CommandInteractionOptionResolver } from 'discord.js';
import { client } from '..';
import { Event } from '../structures/Event';
import { BotInteraction } from '../typings/Command';
export default new Event('interactionCreate', async (interaction) => {
if (interaction.isCommand()) {
await interaction.deferReply();
const command = client.commands.get(interaction.commandName);
if (!command)
return interaction.followUp("This command doesn't exist. Dork.");
command.run({
args: interaction.options as CommandInteractionOptionResolver,
client,
interaction: interaction as BotInteraction,
});
}
});