From e1a29c688db3a6a35b42efc6864c12e394a46717 Mon Sep 17 00:00:00 2001 From: Supositware Date: Mon, 15 Aug 2022 17:23:23 +0200 Subject: [PATCH] Add client to listeners --- index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 93f32693..4f95bf47 100644 --- a/index.js +++ b/index.js @@ -15,6 +15,7 @@ const client = new Client({ intents: [Intents.FLAGS.GUILDS], shards: 'auto' }); client.commands = new Collection(); await loadCommandFromDir('fun'); await loadCommandFromDir('utility'); +await loadCommandFromDir('admin'); await loadCommandFromDir('owner'); // Load events @@ -45,10 +46,10 @@ async function loadEventFromDir(dir, listener) { let event = await import(filePath); event = event.default; if (event.once) { - listener.once(event.name, (...args) => event.execute(...args)); + listener.once(event.name, (...args) => event.execute(...args, client)); } else { - listener.on(event.name, (...args) => event.execute(...args)); + listener.on(event.name, (...args) => event.execute(...args, client)); } } } \ No newline at end of file