{"id":22006091,"url":"https://github.com/eilex/discord.js-embed-menu","last_synced_at":"2025-05-05T21:35:39.784Z","repository":{"id":48328797,"uuid":"369189078","full_name":"eilex/discord.js-embed-menu","owner":"eilex","description":"Easily create Discord.js embed menus with reactions and unlimited customisable pages.","archived":false,"fork":false,"pushed_at":"2021-08-01T10:02:21.000Z","size":116,"stargazers_count":6,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-07T21:49:21.400Z","etag":null,"topics":["bot","discord","discord-apo","discord-bot","discord-js","discord-reaction","discordapp","discordjs","framework","javascript","js","library","menu","reaction","ts","typescript"],"latest_commit_sha":null,"homepage":"https://npm.im/discord.js-embed-menu","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eilex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"custom":["https://www.paypal.me/eilexmrn"]}},"created_at":"2021-05-20T11:46:03.000Z","updated_at":"2024-10-29T16:44:37.000Z","dependencies_parsed_at":"2022-08-20T07:31:38.425Z","dependency_job_id":null,"html_url":"https://github.com/eilex/discord.js-embed-menu","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eilex%2Fdiscord.js-embed-menu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eilex%2Fdiscord.js-embed-menu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eilex%2Fdiscord.js-embed-menu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eilex%2Fdiscord.js-embed-menu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eilex","download_url":"https://codeload.github.com/eilex/discord.js-embed-menu/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252580637,"owners_count":21771372,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","discord","discord-apo","discord-bot","discord-js","discord-reaction","discordapp","discordjs","framework","javascript","js","library","menu","reaction","ts","typescript"],"created_at":"2024-11-30T01:08:55.576Z","updated_at":"2025-05-05T21:35:39.764Z","avatar_url":"https://github.com/eilex.png","language":"TypeScript","funding_links":["https://www.paypal.me/eilexmrn"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cp\u003e\n    \u003ca href=\"https://github.com/eilex/discord.js-embed-menu\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/discord.js-embed-menu\" alt=\"NPM version\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://discord.js.org\"\u003e\u003cimg src=\"https://img.shields.io/npm/dependency-version/discord.js-embed-menu/discord.js\" alt=\"NPM (prod) dependency version\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://nodei.co/npm/discord.js-embed-menu\"\u003e\u003cimg src=\"https://img.shields.io/npm/dt/discord.js-embed-menu\" alt=\"NPM downloads\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://nodei.co/npm/discord.js-embed-menu\"\u003e\u003cimg src=\"https://img.shields.io/npm/dw/discord.js-embed-menu\" alt=\"NPM downloads week\" /\u003e\u003c/a\u003e\n    \n  \u003c/p\u003e\n  \u003cp\u003e\n    \u003ca href=\"https://nodei.co/npm/discord.js-embed-menu/\"\u003e\u003cimg src=\"https://nodei.co/npm/discord.js-embed-menu.png?downloads=true\u0026stars=true\" alt=\"npm installnfo\" /\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n## Table of contents\n\n- [About](#about)\n- [Installation](#installation)\n- [Example usage](#example-usage)\n- [Special destinations](#special-destinations)\n- [Contributing](#contributing)\n- [Links](#links)\n\n## About\n\ndiscord.js-embed-menu is a [Node.js](https://nodejs.org) module based on [discord.js-menu](https://github.com/jowsey/discord.js-menu) that allows you to easily create reaction embeds menu using\n[discord.js](https://discord.js.org/#/).\n\n- Channel and direct message menu\n- Remove other users reactions\n- Pagination system\n- Mention user\n- Timeout and auto delete\n\n## Installation\n\n**Node.js 14.0.0 or newer is required.**  \n\n```shell\nnpm i discord.js-embed-menu --save\n```\n\n## Example usage\n\n```js\n/* Import all the usual stuff. */\nimport { Client, MessageEmbed } from 'discord.js';\nimport { DiscordEmbedMenu } from 'discord.js-embed-menu';\n\nconst client = new Client();\n\n/* Run this code every time a new message is sent. */\nclient.on('message', message =\u003e {\n    if (message.content === '!menu') {\n        /*\n         * The menu class takes 3 mandatory parameters and 5 optional parameters. \n         * 1) A channel to send the menu to, it can be null so it will send DMs to the user.\n         * 2) A user to give control over the navigation or send DM if channel is null.\n         * 3) An array of Page objects or DiscordEmbedMenuPage, each being a unique page of the menu.\n         * 4) How long, in milliseconds, you want the menu to wait for new reactions, it can be null so it will wait for ever (not recommended).\n         * 5) If it shall or not delete the message on menu timeout.\n         * 6) If it shall mention menu's user on discord channels.\n         * 7) If it shall keep last user reaction when you call stop.\n         * 8) The message to be displayed when it's loading the menu page.\n         */\n        let menu = new DiscordEmbedMenu(message.channel, message.author, [\n            {\n                /*\n                 * A page object consists of three items:\n                 * 1) A name. This is used as a unique destination name for reactions.\n                 * 2) Some content. This is a rich embed. You can use {object: formatting} or .functionFormatting() for embeds. Whichever you prefer.\n                 * 3) A set of reactions, linked to either a page destination or a function.* (See example pages)\n                 * \n                 * Reactions can be emojis or custom emote IDs, and reaction destinations can be either the names\n                 * of pages, () =\u003e { functions }, or special destination names. See below for a list of these.\n                 */\n\n                /* You can call pages whatever you like. The first in the array is always loaded first. */\n                name: 'main',\n                content: new MessageEmbed({\n                    title: 'Main menu',\n                    description: 'Please chose an action',\n                    fields: [\n                        {\n                            name: \"📝 Sub menu\",\n                            value: \"Goes to another menu.\",\n                            inline: false\n                        },\n                        {\n                            name: \"✉️ Direct message\",\n                            value: \"Sends a direct message.\",\n                            inline: false\n                        },\n                        {\n                            name: \"❌ Close\",\n                            value: \"Close the menu.\",\n                            inline: false\n                        }\n                    ]\n                }),\n                reactions: {\n                    '📝': 'sub-menu',\n                    '✉️': async (menu) =\u003e {\n                        menu.user.send(`Hello dear ${menu.user.username}.`);\n                    },\n                    '❌': 'delete'\n                }\n            },\n            {\n                name: 'sub-menu',\n                content: new MessageEmbed({\n                    title: 'Sub menu',\n                    description: 'This is another page.',\n                    fields: [\n                        {\n                            name: \"⬅️ Back\",\n                            value: \"Go backwards.\",\n                            inline: false\n                        },\n                        {\n                            name: \"❌ Close\",\n                            value: \"Close the menu.\",\n                            inline: false\n                        }\n                    ]\n                }),\n                reactions: {\n                    '⬅️': 'main',\n                    '❌': 'delete'\n                }\n            }\n        ]);\n\n        /* Run Menu.start() when you're ready to send the menu. */\n        menu.start();\n\n        /* The menu also has two events you can use.\n         * The \"page-changing\" event fires just before a new page is sent.\n         * The \"page-changed\" event fires after the new page is sent.\n         */\n        menu.on('page-changing', (oldPageIndex, oldPage, newPageIndex, newPage) =\u003e {\n            console.log(`Menu is going from \"${oldPage.content.title}\" (${oldPageIndex}) to \"${newPage.content.title}\" (${newPageIndex})`);\n        });\n\n        menu.on('page-changed', (pageIndex, page) =\u003e {\n            console.log(`Menu is now on \"${page.content.title}\" (${pageIndex})`);\n        });\n    }\n});\n\nclient.login(\"Get your bot's oauth token at https://discord.com/developers/applications\");\n```\n\n## Special Destinations\n\nDiscord.js-embed-menu comes with 6 pre-defined destinations with specific uses.\n\n| Destination \t| Function                                                      \t|\n|-------------\t|---------------------------------------------------------------\t|\n| first       \t| Goes to the first page in the array.                          \t|\n| last        \t| Goes to the last page in the array.                           \t|\n| previous    \t| Goes to the previous page in the array.                       \t|\n| next        \t| Goes to the next page in the array.                           \t|\n| stop        \t| Removes reactions from the embed and stops updating the menu. \t|\n| delete      \t| Stops the menu and deletes the message.                       \t|\n\nCalling a page one of these wouldn't work, it prioritizes special destinations.\n\n## Contributing\n\nBefore creating an issue, please ensure that it hasn't already been reported/suggested.\n\n## Links\n\n- [discord.js](https://github.com/discordjs/discord.js)\n- [discord.js-menu](https://github.com/jowsey/discord.js-menu)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feilex%2Fdiscord.js-embed-menu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feilex%2Fdiscord.js-embed-menu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feilex%2Fdiscord.js-embed-menu/lists"}