discord-menu-embed
v1.0.2
Published
discord-menu-embed is a package that allows users to easily create multiple embeds with menu/dropdown.
Downloads
13
Maintainers
Readme
discord-menu-embed is a package that allows users to easily create multiple embeds with menu/dropdown.
How to use 📃
Importing 🐱👤
var Discord = require("discord.js");
const Buttons = require("discord-buttons");
const ButtonsMenu = require("discord-menu-embed");
const Client = new Discord.Client();
Buttons(Client);
ButtonsMenu(Client);
Discord.MessageMenu = Buttons.MessageMenu;
Discord.MessageMenuOption = Buttons.MessageMenuOption;
Discord.MessageActionRow = Buttons.MessageActionRow;
Method 📚
(method) ExtendTextChannel.menu(author: string, options?: {
embeds?: any[];
menu?: {
id?: string;
placeholder?: string;
selects?: {
value?: string;
emoji?: string;
label?: string;
description?: string;
}[];
};
timeout?: string | number;
}): void
Example 🐱🐉
var embeds = [], menu = {};
const content = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
for (var i = 0; i < content.length; i++) {
const embed = new Discord.MessageEmbed();
embed.setDescription(`ID: ${content[i]}`);
embeds.push(embed);
}
menu.id = "menuyea";
menu.placeholder = "choose or ban";
menu.selects = [];
for (var i = 0; i < content.length; i++) {
const select = {
id: `select_${content[i]}`,
label: `Option ${content[i]} `,
description: `${content[i]} - select... description..`
};
menu.selects.push(select);
}
message.channel.menu(message.author.id, {
embeds: embeds,
menu: menu
});