Skip to content

Commit

Permalink
🐛 | #5 Context Menu [FIXED]
Browse files Browse the repository at this point in the history
  • Loading branch information
NamVr committed Sep 4, 2021
1 parent 754f9aa commit e3bc1d2
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
22 changes: 22 additions & 0 deletions bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,28 @@ for (const module of buttonCommands) {
}
}

/**********************************************************************/
// Registration of select-menus Interactions

/**
* @type {String[]}
* @description All Select Menu commands.
*/

const selectMenus = fs.readdirSync("./interactions/select-menus");

// Loop through all files and store select-menus in slashCommands collection.

for (const module of selectMenus) {
const commandFiles = fs
.readdirSync(`./interactions/select-menus/${module}`)
.filter((file) => file.endsWith(".js"));
for (const commandFile of commandFiles) {
const command = require(`./interactions/select-menus/${module}/${commandFile}`);
client.selectCommands.set(command.id, command);
}
}

/**********************************************************************/
// Registration of Slash-Commands in Discord API

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "discordbot-template",
"version": "3.0.0",
"version": "3.0.1",
"description": "A modified template based on discordjs.guide to create your own discord-js based bot!",
"main": "bot.js",
"scripts": {
Expand Down

0 comments on commit e3bc1d2

Please sign in to comment.