{"id":15021697,"url":"https://github.com/gazmull/discord-paginationembed","last_synced_at":"2025-08-20T22:32:18.635Z","repository":{"id":48486704,"uuid":"124461390","full_name":"gazmull/discord-paginationembed","owner":"gazmull","description":"A pagination utility for MessageEmbed in Discord.JS","archived":false,"fork":false,"pushed_at":"2021-08-03T12:55:09.000Z","size":1857,"stargazers_count":84,"open_issues_count":7,"forks_count":16,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-07-29T04:24:35.402Z","etag":null,"topics":["discord-js","embeds","leaderboard","messageembed","paged","pages","pagination","paginationembed","utility"],"latest_commit_sha":null,"homepage":"https://docs.thegzm.space/discord-paginationembed","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/gazmull.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-08T23:39:56.000Z","updated_at":"2025-07-16T01:05:11.000Z","dependencies_parsed_at":"2022-08-19T13:32:06.527Z","dependency_job_id":null,"html_url":"https://github.com/gazmull/discord-paginationembed","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/gazmull/discord-paginationembed","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gazmull%2Fdiscord-paginationembed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gazmull%2Fdiscord-paginationembed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gazmull%2Fdiscord-paginationembed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gazmull%2Fdiscord-paginationembed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gazmull","download_url":"https://codeload.github.com/gazmull/discord-paginationembed/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gazmull%2Fdiscord-paginationembed/sbom","scorecard":{"id":420176,"data":{"date":"2025-08-11","repo":{"name":"github.com/gazmull/discord-paginationembed","commit":"38488a63fb8716cdb8dbe77cfdc644483fbc666d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":2,"reason":"Found 7/30 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'","Warn: branch protection not enabled for branch 'stable'","Warn: branch protection not enabled for branch 'v11'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 9 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T00:59:43.248Z","repository_id":48486704,"created_at":"2025-08-19T00:59:43.248Z","updated_at":"2025-08-19T00:59:43.248Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271397965,"owners_count":24752641,"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","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["discord-js","embeds","leaderboard","messageembed","paged","pages","pagination","paginationembed","utility"],"created_at":"2024-09-24T19:56:54.931Z","updated_at":"2025-08-20T22:32:18.348Z","avatar_url":"https://github.com/gazmull.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Discord.JS - PaginationEmbed\nA pagination utility for MessageEmbed in Discord.JS\n\n[![Discord Server](https://discordapp.com/api/guilds/370614673122263041/embed.png)](https://discord.gg/eDUzT87)\n[![Travis (.org) branch](https://img.shields.io/travis/gazmull/discord-paginationembed/master.svg?logo=travis\u0026style=flat-square)](https://travis-ci.org/gazmull/discord-paginationembed)\n[![npm peer dependency version](https://img.shields.io/npm/dependency-version/discord-paginationembed/peer/discord.js.svg?logo=npm\u0026style=flat-square)](https://nodei.co/npm/discord-paginationembed/)\n[![npm type definitions](https://img.shields.io/npm/types/discord-paginationembed.svg?logo=npm\u0026style=flat-square)](https://nodei.co/npm/discord-paginationembed/)\n\n[![NPM](https://nodei.co/npm/discord-paginationembed.png?downloads=true\u0026stars=true)](https://nodei.co/npm/discord-paginationembed/)\n\n## 📣 Notice Board\n- [**Changelog**](https://github.com/gazmull/discord-paginationembed/blob/master/CHANGELOG.md)\n- [**Updating from `v1`**](https://github.com/gazmull/discord-paginationembed/blob/master/UPDATING_V2.md)\n- Recently updated to `v2`! If **[Documentation]** feels off, please clear site cache!\n- This utility no longer provide updates for v1 (Discord.JS **11**)\n\n## 🎉 Welcome\n- ✔ **Typings** included\n- ✔ **[Documentation]** for online references\n- ✔ **Asynchronous** workflow\n- ✔ Supports [Discord.JS **12**](https://discord.js.org \"Go to Discord.JS Documentation\")\n- ❔ Nothing found within docs or need a nudge? You may visit the [**Discord server**](https://discord.gg/eDUzT87)\n\n## 🛠 Installation\n- **Requires Discord.JS 12**: `npm install discord.js`\n- **PaginationEmbed**:\n    - **Published**: `npm install discord-paginationembed@beta`\n    - **Unpublished**: `npm install gazmull/discord-paginationembed`\n      - ❗ Requires [**Git**](https://git-scm.com/)\n\n## 🔰 Examples\n\u003e [**Test Unit Example**](https://github.com/gazmull/discord-paginationembed/blob/master/test)\n\n\u003e [**Preface for TypeScript Projects**](https://github.com/gazmull/discord-paginationembed/blob/master/UPDATING_V1.md#TypeScript)\n\n### In-action samples:\n- [**Pages of command description**](https://github.com/gazmull/eros-bot/blob/master/src/commands/general/guide.ts#L35)\n- [**Toggle between character and its weapon, and toggle image visibility**](https://github.com/gazmull/eros-bot/blob/master/src/commands/kamihime/info.ts#L180)\n- [**EXP Leaderboard**](https://github.com/gazmull/eros-bot/blob/master/src/commands/level/leaderboard.ts#L23)\n- [**Music Queue**](https://github.com/gazmull/ramiel-bot/blob/master/src/commands/music/queue.ts#L38)\n\n\u003cbr\u003e\n\n### ⚠ Warning\n- Examples are written under `message` event!\n- There are some methods not shown in the examples. If you want to know more methods to fiddle, please visit the **[Documentation]**\n\n### There are two modes of pagination\n\n#### `FieldsEmbed` Mode\n- A pagination mode that uses a MessageEmbed with a field(s) containing the elements to paginate.\n- Usually used for simple listing such as leaderboards and queues.\n\n```js\nconst Pagination = require('discord-paginationembed');\n\nconst FieldsEmbed = new Pagination.FieldsEmbed()\n  // A must: an array to paginate, can be an array of any type\n  .setArray([{ word: 'they are' }, { word: 'being treated' }])\n  // Set users who can only interact with the instance. Default: `[]` (everyone can interact).\n  // If there is only 1 user, you may omit the Array literal.\n  .setAuthorizedUsers([message.author.id])\n   // A must: sets the channel where to send the embed\n  .setChannel(message.channel)\n  // Elements to show per page. Default: 10 elements per page\n  .setElementsPerPage(2)\n   // Have a page indicator (shown on message content). Default: false\n  .setPageIndicator(false)\n   // Format based on the array, in this case we're formatting the page based on each object's `word` property\n  .formatField('Continue...', el =\u003e el.word);\n\n// Customise embed\nFieldsEmbed.embed\n  .setColor(0x00FFFF)\n  .setTitle('Jesus Yamato Saves the Day by Obliterating a Swarm of Abyssal Bombers!')\n  .setDescription('Akagi and Kaga give their thanks to their holy saviour today as...')\n  .setImage('https://lh5.googleusercontent.com/-TIcwCxc7a-A/AAAAAAAAAAI/AAAAAAAAAAA/Hij7_7Qa1j0/s900-c-k-no/photo.jpg');\n\n// Deploy embed\nFieldsEmbed.build();\n```\n![FieldsEmbed](https://github.com/gazmull/discord-paginationembed/blob/master/demo/FieldsEmbed.png?raw=true)\n\n#### Working with Asynchronous Behaviour\n\u003e This assumes this is under an `async` function\n\n```js\nconst Pagination = require('discord-paginationembed');\n\nconst FieldsEmbed = new Pagination.FieldsEmbed()\n  .setArray([{ name: 'John Doe' }, { name: 'Jane Doe' }])\n  .setAuthorizedUsers([message.author.id])\n  .setChannel(message.channel)\n  .setElementsPerPage(1)\n  // Initial page on deploy\n  .setPage(2)\n  .setPageIndicator(true)\n  .formatField('Name', i =\u003e i.name)\n  // Deletes the embed upon awaiting timeout\n  .setDeleteOnTimeout(true)\n  // Disable built-in navigation emojis, in this case: 🗑 (Delete Embed)\n  .setDisabledNavigationEmojis(['delete'])\n  // Set your own customised emojis\n  .setFunctionEmojis({\n    '🔄': (user, instance) =\u003e {\n      const field = instance.embed.fields[0];\n\n      if (field.name === 'Name')\n        field.name = user.tag;\n      else\n        field.name = 'Name';\n    }\n  })\n  // Similar to setFunctionEmojis() but this one takes only one emoji\n  .addFunctionEmoji('🅱', (_, instance) =\u003e {\n    const field = instance.embed.fields[0];\n\n    if (field.name.includes('🅱'))\n      field.name = 'Name';\n    else\n      field.name = 'Na🅱e';\n  })\n  // Sets whether function emojis should be deployed after navigation emojis\n  .setEmojisFunctionAfterNavigation(false);\n\nFieldsEmbed.embed\n  .setColor(0xFF00AE)\n  .setDescription('Test Description');\n\nawait FieldsEmbed.build();\n\n// Will not log until the instance finished awaiting user responses\n// (or techinically emitted either `expire` or `finish` event)\nconsole.log('done');\n```\n![FieldsEmbed2](https://github.com/gazmull/discord-paginationembed/blob/master/demo/FieldsEmbed2.gif?raw=true)\n\n---\n\n### `Embeds` Mode\n- A pagination mode that uses an array of MessageEmbed to paginate.\n- Usually used for complex builds such as characters' information.\n\n```js\nconst Discord = require('discord.js');\nconst Pagination = require('discord-paginationembed');\n\nconst embeds = [];\n\nfor (let i = 1; i \u003c= 5; ++i)\n  embeds.push(new Discord.MessageEmbed().addField('Page', i));\n\nconst myImage = message.author.displayAvatarURL();\n\nnew Pagination.Embeds()\n  .setArray(embeds)\n  .setAuthorizedUsers([message.author.id])\n  .setChannel(message.channel)\n  .setPageIndicator(true)\n  .setPage(3)\n   // Methods below are for customising all embeds\n  .setImage(myImage)\n  .setThumbnail(myImage)\n  .setTitle('Test Title')\n  .setDescription('Test Description')\n  .setFooter('Test Footer Text')\n  .setURL(myImage)\n  .setColor(0xFF00AE)\n  .addField('\\u200b', '\\u200b')\n  .addField('Test Field 1', 'Test Field 1', true)\n  .addField('Test Field 2', 'Test Field 2', true)\n  .build();\n```\n![Embeds](https://user-images.githubusercontent.com/32944712/37118454-41116cbe-228f-11e8-9878-f39db26316a1.png)\n\n\u003e This assumes this is under an `async` function\n\n```js\nconst Discord = require('discord.js');\nconst Pagination = require('discord-paginationembed');\n\nconst embeds = [];\n\nfor (let i = 1; i \u003c= 5; ++i)\n  embeds.push(new Discord.MessageEmbed().addField('Page', i));\n\nconst Embeds = new PaginationEmbed.Embeds()\n  .setArray(embeds)\n  .setAuthorizedUsers([message.author.id])\n  .setChannel(message.channel)\n  .setPageIndicator(true)\n  .setTitle('Test Title')\n  .setDescription('Test Description')\n  .setFooter('Test Footer Text')\n  .setURL('https://gazmull.github.io/discord-paginationembed')\n  .setColor(0xFF00AE)\n  // Sets the client's assets to utilise. Available options:\n  //  - message: the client's Message object (edits the message instead of sending new one for this instance)\n  //  - prompt: custom content for the message sent when prompted to jump to a page\n  //      {{user}} is the placeholder for the user mention\n  .setClientAssets({ message, prompt: 'Page plz {{user}}' })\n  .setDeleteOnTimeout(true)\n  .setDisabledNavigationEmojis(['delete'])\n  .setFunctionEmojis({\n    '⬆': (_, instance) =\u003e {\n      for (const embed of instance.array)\n        embed.fields[0].value++;\n    },\n    '⬇': (_, instance) =\u003e {\n      for (const embed of instance.array)\n        embed.fields[0].value--;\n    }\n  })\n  // Listeners for PaginationEmbed's events\n  // After the initial embed has been sent\n  // (technically, after the client finished reacting with enabled navigation and function emojis).\n  .on('start', () =\u003e console.log('Started!'))\n  // When the instance is finished by a user reacting with `delete` navigation emoji\n  // or a function emoji that throws non-Error type.\n  .on('finish', (user) =\u003e console.log(`Finished! User: ${user.username}`))\n  // Upon a user reacting on the instance.\n  .on('react', (user, emoji) =\u003e console.log(`Reacted! User: ${user.username} | Emoji: ${emoji.name} (${emoji.id})`))\n  // When the awaiting timeout is reached.\n  .on('expire', () =\u003e console.warn('Expired!'))\n  // Upon an occurance of error (e.g: Discord API Error).\n  .on('error', console.error);\n\nawait Embeds.build();\n```\n![Embeds2](https://github.com/gazmull/discord-paginationembed/blob/master/demo/Embeds.gif?raw=true)\n\n## 💡🐛💻 Contributing\n### Bug Reports\nPlease provide reproducible steps and results proofs (e.g: images). Also, solutions are welcome!\n\n### Suggestions / Discussions\nPlease be explicit about the feature's description and provide a valid reason (e.g: beneficial to users or development time) why it should be added/changed/removed.\n\n### Source Code\n- Fork this repository.\n- Execute `npm install`\n- Code and code and code and code and... code!\n  - To enable [**incremental compilation**](https://en.wikipedia.org/wiki/Incremental_compiler) to JS: `npm run dev:watch`\n- `npm test` to verify if your additions/adjustments are following the project's codebase rules and to verify if the docs are valid.\n- Please make sure that you have tested your changes very well.\n    - There is a test bot script under `test` folder. To get started:\n        - Copy `credentials.sample.js` to `credentials.js` and fill up your private credentials (token, test channel, etc)\n        - Execute either:\n          - One-time test: `npm run test:bot`\n          - Hot-reloading test (nodemon): `npm run dev:start`\n- File a [**Pull Request (PR)**](https://github.com/gazmull/discord-paginationembed/compare)!\n- For the PR comment, it goes the same with **`Suggestions / Discussions`**.\n\n# License\n\u003e [**MIT**](https://github.com/gazmull/discord-paginationembed/blob/master/LICENSE)\n\n© 2018-present [**Euni (gazmull)**](https://github.com/gazmull)\n\n[Documentation]: https://gazmull.github.io/discord-paginationembed/master\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgazmull%2Fdiscord-paginationembed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgazmull%2Fdiscord-paginationembed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgazmull%2Fdiscord-paginationembed/lists"}