4.0.0 • Published 1 year ago
v13-extra-menus v4.0.0
About
v13-extra-menus is a powerful Node.js module that allows you to easily create v14 menus on djs v13
Dependencies
Needs discord.js v13 NOT WORKING IN V14 If discord.js isn't installed yet :
npm install discord.js@13-latest
Installation
npm i v13-extra-menus
Importing
Javascript
const {
UserSelectMenuBuilder,
ActionRowBuilder,
use,
ChannelSelectMenuBuilder,
RoleSelectMenuBuilder,
MentionableSelectMenuBuilder,
} = require("v13-extra-menus");
First set the client with the use methode
const { use } = require("v13-extra-menus");
const { Client } = require("discord.js");
const client = new Client({
intents: [3767],
});
use(); // This is important in v3 version we dont use client anymore
Here is how to create the menus...
//importing the builders
const {
UserSelectMenuBuilder,
ActionRowBuilder,
ChannelSelectMenuBuilder,
RoleSelectMenuBuilder,
MentionableSelectMenuBuilder,
} = require("v13-extra-menus");
//create a row
const row = new ActionRowBuilder();
//then create a menu
const menu = new UserSelectMenuBuilder({
customId: "test", //custom id is required
placeholder: "test", //placeholder is not required but it's recommended
maxValues: 5, //max values is not required but it's recommended
minValues: 1, //min values is not required but it's recommended
//you can see discord js docs for more info
});
//adding the menu to the row
row.addComponents(menu);
//redo the same for the other menus
const menu2 = new ChannelSelectMenuBuilder({
customId: "test2",
placeholder: "test2",
maxValues: 5,
});
const row2 = new ActionRowBuilder();
row2.addComponents(menu2);
const menu3 = new RoleSelectMenuBuilder({
customId: "test3",
placeholder: "test3",
maxValues: 5,
});
const row3 = new ActionRowBuilder();
row3.addComponents(menu3);
const menu4 = new MentionableSelectMenuBuilder({
customId: "test4",
placeholder: "test4",
minValues: 1,
maxValues: 5,
});
const row4 = new ActionRowBuilder();
row4.addComponents(menu4);
//send the message with the menus
message.channel.send({ content: "test", components: [row, row2, row3, row4] });
Receiving the menus
const collector = message.createMessageComponentCollector({
componentType: "UserSelectMenu", //componentType are listed below
time: 100000,
});
collector.on("collect", async (interaction) => {
if (interaction.customId === "test") {
//do something with the interaction
}
});
ComponentType
You gonna need this if you want to create a collector and filter the menus
Types |
---|
UserSelectMenu |
ChannelSelectMenu |
RoleSelectMenu |
MentionableSelectMenu |
Trouble
Having a problem using v13-extra-menus ? Open an issue on Github & Don't hesitate to send a message to the discord tag below 👇 !
Credits
Made by Combo-Miner (!"Unkown#6666
on discord)