added basic functions

This commit is contained in:
2023-08-02 14:16:30 +02:00
parent 0c1cc63b9b
commit b68cb0b219
7 changed files with 139 additions and 7 deletions

View File

@@ -0,0 +1,22 @@
const { Events } = require('discord.js');
module.exports = {
name: Events.InteractionCreate,
async execute(interaction) {
if (!interaction.isChatInputCommand()) return;
const command = interaction.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);
}
},
};

View File

@@ -0,0 +1,12 @@
const { Events } = require('discord.js');
const deployCommands = require('../functions/deployCommands');
module.exports = {
name: Events.ClientReady,
once: true,
execute(client) {
console.log(`Ready! Logged in as ${client.user.tag}`);
deployCommands();
},
};