This commit is contained in:
2023-11-07 12:19:25 +01:00
parent 54eae36b13
commit 13ac74a764
11 changed files with 186 additions and 3 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);
}
},
};

8
events/messageCreate.js Normal file
View File

@@ -0,0 +1,8 @@
const { Events } = require('discord.js');
module.exports = {
name: Events.MessageCreate,
async execute(message) {
console.log(`${message.author.globalName}: ${message.content}`);
},
};

9
events/ready.js Normal file
View File

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