feat(cmd/deploy): adding the deploy command
This commit is contained in:
parent
bca3bd0c2a
commit
2b02553a4c
6 changed files with 250 additions and 0 deletions
30
src/events/interaction/interaction.ts
Normal file
30
src/events/interaction/interaction.ts
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
import { Events, MessageFlags } from 'discord.js'
|
||||
|
||||
export default {
|
||||
name: Events.InteractionCreate,
|
||||
async execute(interaction) {
|
||||
if (!interaction.isChatInputCommand())
|
||||
return;
|
||||
const command = interaction.client.commands.get(interaction.commandName);
|
||||
if (!command) {
|
||||
console.error(`⚠️ | Can't execute ${interaction.commandName}`);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await command.execute(interaction);
|
||||
} catch (error) {
|
||||
console.error(`⚠️ | Error when occured this command ${interaction.commandName}\n\t${error}`);
|
||||
if (interaction.replied || interaction.deferred) {
|
||||
await interaction.followUp({
|
||||
content: `<a:error:1398985025688436797> | ${interaction.commandName} seems have a problem, thanks report that to the support (After Print)`,
|
||||
flags: MessageFlags.Ephemeral
|
||||
});
|
||||
} else {
|
||||
await interaction.reply({
|
||||
content: `<a:error:1398985025688436797> | ${interaction.commandName} seems have a problem, thanks report that to the support (Before Print)`,
|
||||
flags: MessageFlags.Ephemeral
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue