Skip to content

Commit

Permalink
components: fix dupes
Browse files Browse the repository at this point in the history
  • Loading branch information
jbcarreon123 committed Feb 20, 2024
1 parent bfb5757 commit 5382644
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
15 changes: 0 additions & 15 deletions src/bot/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ for (const folder of commandFolders) {
logger.info("Loading buttons");
client.buttons = new Map();
const buttonsPath = path.join(import.meta.dir, "./components/buttons");
const buttonsPath = path.join(import.meta.dir, "./components/buttons");
const buttonFiles = fs
.readdirSync(buttonsPath)
.filter((file: string) => file.endsWith(".ts"));
Expand All @@ -55,20 +54,6 @@ for (const file of buttonFiles) {
client.buttons.set(button.data.customId, button);
}

// Load select menus
logger.info("Loading select menus");
client.selectMenus = new Map();
const selectMenusPath = path.join(import.meta.dir, "./components/selectmenus");
const selectMenuFiles = fs
.readdirSync(selectMenusPath)
.filter((file: string) => file.endsWith(".ts"));

for (const file of selectMenuFiles) {
const selectMenu = require(`${selectMenusPath}/${file}`);
client.selectMenus.set(selectMenu.data.customId, selectMenu);
}


// Load select menus
logger.info("Loading select menus");
client.buttons = new Map();
Expand Down
2 changes: 1 addition & 1 deletion src/utils/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const transport = pino.transport({
},
{
target: "pino/file",
options: { destination: path.join(__dirname, "../logs/log.log") },
options: { destination: path.join(import.meta.dir, "../logs/log.log") },
},
],
});
Expand Down

0 comments on commit 5382644

Please sign in to comment.