docker builds successfully, now need to figure out websocket connection
This commit is contained in:
24
src/events/interactionCreate.ts
Normal file
24
src/events/interactionCreate.ts
Normal file
@ -0,0 +1,24 @@
|
||||
import { Events, Interaction } from 'discord.js';
|
||||
import { DiscordClient } from '../discordClient';
|
||||
|
||||
module.exports = {
|
||||
name: Events.InteractionCreate,
|
||||
async execute(interaction: Interaction) {
|
||||
if (!interaction.isChatInputCommand()) return;
|
||||
|
||||
const client = interaction.client as DiscordClient;
|
||||
const command = client.commands.get(interaction.commandName);
|
||||
|
||||
if (!command) {
|
||||
console.error(`No command matching ${interaction.commandName} was found.`);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await command.execute(interaction);
|
||||
} catch (error) {
|
||||
console.error(`Error executing ${interaction.commandName}`);
|
||||
console.error(error);
|
||||
}
|
||||
},
|
||||
};
|
Reference in New Issue
Block a user