npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

djs-menu-v13

v1.0.2

Published

A module for create simple and complex menu for your Discord Bot

Readme

djs-menu-v13

Create menu for your Discord Bot very easly

  • Make for Discord.js V13

    • Work with Interaction
  • Create simple and complex Menu

    • with button and select menu
  • Support event and callbacks

    • For do whatever you want

Usefull link

How to use it ?

First step

First you need to install the module with

npm i djs-menu-v13

Then, import the module in your code

import {Menu, MenuPage} from 'djs-menu-v13';
// Or with require
const {Menu, MenuPage} = require('djs-menu-v13');

For this example, we gonna make two pages :

  • The first one with a basic embed and a button to go to the second page
  • The second one with a button to return to the first page and a button to exit the menu

First we need to create all the buttons we need :

const nextPageBtn = {
    label: 'Go to second page',
    target: 'secondPage', // The target is the ID of the page that we need to display when this button is clicked
    style: 'PRIMARY',
};

const previousPageBtn = {
    label: 'Go to first page',
    target: 'firstPage',
    style: 'PRIMARY',
};

const exitBtn = {
    label: 'Exit',
    // You can also put a function to execute when the button is clicked
    target: (page, interaction, menu) => {
        menu.stop();
        interaction.editReply({
            content: 'The menu has just been closed',
            embeds: [],
            components: [],
        });
    },
    style: 'DANGER',
};

Then we need to create two embeds for our pages. You don't have to use an embed to make a page, just a content is enough.

const firstEmbed = new MessageEmbed()
    .setColor('GREEN')
    .setDescription('FIRST PAGE');

const secondEmbed = new MessageEmbed()
    .setColor('YELLOW')
    .setDescription('SECOND PAGE'); 

Now we can create our pages.

const firstPage = new MenuPage()
    .addEmbed(firstEmbed)
    .addButton(nextPageBtn)
    .setId('secondPage'); // The id that the target in the button will use

const secondPage = new MenuPage()
    .addEmbed(secondEmbed)
    .addButton(previousPageBtn)
    .addButton(exitBtn)
    .setId('secondPage');

And finaly create the menu and start it

const menu = new Menu(interaction)
    .addPage(firstPage)
    .addPage(secondPage)
    .start('firstPage');

GG you just start your first menu ! Now, you can listen to events emit by your menu

menu.on('stop', (interaction, reason) => {
  if (reason === 'noReply' ) {
    // Don't forget to clear embeds and components generated by the menu
      interaction.editReply({
        embeds: [], 
        components: [],
        content: 'You did not respond quickly enough',
      });
  }
});

menu.on('pageChanged', (page, interaction, pages) => {
  console.log('the page just changed');
});

Full code example here

Menu with Select Menu

You can also use select menu with buttons. Check this example to know how