Abheek Dhawan
3 years ago
3 changed files with 40 additions and 19 deletions
@ -0,0 +1,20 @@ |
|||||
|
module.exports = { |
||||
|
name: 'interactionCreate', |
||||
|
once: false, |
||||
|
async execute(interaction) { |
||||
|
const client = interaction.client; |
||||
|
if (!interaction.isCommand()) return; |
||||
|
|
||||
|
const command = client.commands.get(interaction.commandName); |
||||
|
|
||||
|
if (!command) return; |
||||
|
|
||||
|
try { |
||||
|
await command.execute(interaction); |
||||
|
} |
||||
|
catch (error) { |
||||
|
console.error(error); |
||||
|
await interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true }); |
||||
|
} |
||||
|
}, |
||||
|
}; |
@ -0,0 +1,11 @@ |
|||||
|
const db = require('../helpers/db'); |
||||
|
const { mongoUri } = require('../helpers/env'); |
||||
|
|
||||
|
module.exports = { |
||||
|
name: 'ready', |
||||
|
once: true, |
||||
|
async execute(client) { |
||||
|
await db.connect(mongoUri); |
||||
|
console.log(`Logged in at ${client.user.tag}!`); |
||||
|
}, |
||||
|
}; |
Loading…
Reference in new issue