pass root logger, don't init new ones

This commit is contained in:
JT2M0L3Y
2026-10-21 19:31:02 -07:00
parent 217291e531
commit 288c0eb08f
16 changed files with 56 additions and 62 deletions
+3 -3
View File
@@ -5,15 +5,15 @@ import commands from '../commands/index.js'
* Interaction creation listener for the client
* @param interaction the interaction received from the server
*/
export default event(Events.InteractionCreate, async ({ log, client }, interaction) => {
export default event(Events.InteractionCreate, async ({ logger, client }, interaction) => {
if (!interaction.isCommand() || !interaction.isChatInputCommand()) return
log.info({ command: interaction.commandName, user: interaction.user.tag }, 'Interaction received')
logger.info({ command: interaction.commandName, user: interaction.user.tag }, 'Interaction received')
// ensure command exists, otherwise kill event
const command = commands.find(command => command.name === interaction.commandName)
if (!command) return
// the command exists, execute it
command.run(client, interaction)
command.run(client, interaction, logger)
})