Napoleonic Political Magnificence

    discord-menu-embed

    1.0.2 • Public • Published

    NPM

    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
    });

    Support Server 👨🏻‍🤝‍👨🏻

    Discord

    Install

    npm i discord-menu-embed

    DownloadsWeekly Downloads

    167

    Version

    1.0.2

    License

    Apache-2.0

    Unpacked Size

    20.2 kB

    Total Files

    5

    Last publish

    Collaborators

    • nekoyasuii