respond with command list when @mentioned
This commit is contained in:
@ -2,23 +2,23 @@ import { Events, Interaction } from 'discord.js';
|
||||
import { DiscordClient } from '../discordClient';
|
||||
|
||||
module.exports = {
|
||||
name: Events.InteractionCreate,
|
||||
async execute(interaction: Interaction) {
|
||||
if (!interaction.isChatInputCommand()) return;
|
||||
name: Events.InteractionCreate,
|
||||
async execute(interaction: Interaction) {
|
||||
if (!interaction.isChatInputCommand()) return;
|
||||
|
||||
const client = interaction.client as DiscordClient;
|
||||
const command = client.commands.get(interaction.commandName);
|
||||
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;
|
||||
}
|
||||
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);
|
||||
}
|
||||
},
|
||||
try {
|
||||
await command.execute(interaction);
|
||||
} catch (error) {
|
||||
console.error(`Error executing ${interaction.commandName}`);
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user