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

discord-menu-buttons

v1.4.7

Published

Create a configurable Menu with the new Discord Buttons

Readme

Description

A life-changing module for beginners

This module will easily permit you to build customizable messages menus with buttons.

Getting Started

Installation

npm install discord.js
npm install discord-buttons
npm install discord-menu-buttons

discord.js v12.5.3

discord-buttons v4.0.0

Documentation

Menu

const menu = new Menu(channel, target, pages, time, deleted);

Properties

channel (TextChannel | DMChannel) - The channel where the Menu will be initialized.

target (Snowflake) - The target of the Menu, if any.

pages (Object[]) - The Pages of the Menu.

pages.name (String) - The name of the page.

pages.content (String | MessageEmbed) - The content of the page.

pages.buttons (Button[]) - The buttons of the page.

time (Number) - The time, in milliseconds, after which the Menu will be closed if not any clicking are valid.

deleted (Boolean) - If the Menu will be deleted after the stored time.

Functions

start() - Start the menu.

async awaitButtons() (Promise) - Await for a valid button to be pressed by the authorized user(s).

updateMenu(page) (void) - Update the Menu with the given page number.

--- page (Number) - The number of the page.

stop(force) (void) - Stop the Menu and delete it if has been forced or initialized.

--- force (Boolean) - Overwrite the initialized value deleted.

Button

const button = new Button();

Functions

setFunction(fn) (void) - The function that will be executed when the button will be clicked, if any.

--- fn(button, menu) (Function) - The function using the collected button and the menu as parameters.

------ button (MessageButton) - The received button.

------ menu (Menu) - The started Menu.

Personnalized ID

You can setID() a special ID on your Button, which will be recognized by the module.

previous - Go the the previous page, if possible.

next - Go to the next page, if possible.

start - Go to the first page.

end - Go to the last page.

function - Launch the added function.

delete - Delete the Menu.

stop - Stop the Menu and delete it if it has been initialized.

discord-buttons

For all the others functions, you need to take a look at the documentation of the discord-buttons module.

Examples

Basic Usage

const { MessageEmbed } = require('discord.js');
const { Menu, Button } = require('discord-menu-buttons');

const next = new Button()
            .setLabel("▶")
            .setID("next")
            .setStyle("blurple");
const stop = new Button()
             .setLabel('⛔')
             .setID('stop')
             .setStyle('red');
const previous = new Button()
                .setLabel("◀")
                .setID("previous")
                .setStyle("blurple");

const buttons = [ previous, stop, next ];
const pages = [
    { name: '1', content: new MessageEmbed().setDescription('Page one.'), buttons: buttons },
    { name: '2', content: new MessageEmbed().setDescription('Page two.'), buttons: buttons },
    { name: '3', content: new MessageEmbed().setDescription('Page three.'), buttons: buttons }
]

const menu = new Menu(message.channel, message.author.id, pages, null, false);
menu.start();

setFunction(button, menu) Usage

const love = (button, menu) => {
    button.message.react("❤");
    menu.stop(false);
}

const button = new Button()
               .setLabel("Click me !")
               .setFunction(love)
               .setStyle("red")
               .setID('function');

const pages = [{
    name: "love", content: "Wanna be loved?", buttons: [ button ]
}]

new Menu(message.channel, message.author.id, pages, null, false).start();

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Discord - ValuWaurld#7720

Email - [email protected]