Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jbcarreon123 committed Feb 20, 2024
2 parents 83bc69b + fa05ccf commit bfb5757
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/bot/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ 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 @@ -67,6 +68,20 @@ for (const file of selectMenuFiles) {
client.selectMenus.set(selectMenu.data.customId, selectMenu);
}


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

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

// Load modals
logger.info("Loading modals");
client.modals = new Map();
Expand Down

0 comments on commit bfb5757

Please sign in to comment.