{"id":20151861,"url":"https://github.com/bimoware/dispage","last_synced_at":"2025-04-07T13:13:53.843Z","repository":{"id":65522423,"uuid":"483415886","full_name":"bimoware/dispage","owner":"bimoware","description":"The easiest and most customizable discord.js embed button page system you didn't know you needed.","archived":false,"fork":false,"pushed_at":"2025-01-22T00:00:39.000Z","size":122,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-15T03:51:25.798Z","etag":null,"topics":["bot","discord","discord-bot","discord-js","discordbot","discordjs"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/dispage","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bimoware.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-19T21:31:21.000Z","updated_at":"2024-06-30T14:52:38.000Z","dependencies_parsed_at":"2024-06-18T01:59:49.672Z","dependency_job_id":null,"html_url":"https://github.com/bimoware/dispage","commit_stats":null,"previous_names":["makouille/dispage","voxlinou1/dispage"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bimoware%2Fdispage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bimoware%2Fdispage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bimoware%2Fdispage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bimoware%2Fdispage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bimoware","download_url":"https://codeload.github.com/bimoware/dispage/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247657270,"owners_count":20974345,"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-bot","discord-js","discordbot","discordjs"],"created_at":"2024-11-13T23:07:17.375Z","updated_at":"2025-04-07T13:13:53.810Z","avatar_url":"https://github.com/bimoware.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\u003ch1\u003eDispage\u003c/h1\u003e\u003c/div\u003e\n\n## About\n\ndispage is a powerful [Node.js](https://nodejs.org) module that allows you to easily create button to switch over embed pages on a discord message.\n- [discord.js](https://npmjs.com/package/discord.js)\n- [Discord API](https://discord.com/developers/docs/intro).\n\n## Dependencies\n\n**Needs discord.js v14.6.0 or higher.**\nIf discord.js isn't installed yet :\n```sh-session\nnpm install discord.js@latest\n```\n\n## Installation\n```sh-session\nnpm i dispage\n```\n\n## Importing\n### Javascript\n```js\nconst Dispage = require('dispage')\n```\n### Typescript\n```ts\nimport Dispage from 'dispage';\n```\n### Simple example\n```js\nconst embeds = [\n    new MessageEmbed().setDescription('Embed #1'),\n    new MessageEmbed().setDescription('Embed #2')\n];\nreturn new Dispage()\n    .setEmbeds(embeds)\n    .start(message)\n```\n![Simple example](https://iili.io/Xf3MhP.png)\n\n### If you want to push things further...\n```js\nconst embeds = [\n    'embed 1',\n    'embed 2 !!',\n    'embed 3 !?!',\n    'embed 4 !!!!!!!!?'\n].map((desc, i) =\u003e new Discord.EmbedBuilder()\n    .setTitle(`📃 Page #${i + 1}`)\n    .setColor('BLURPLE')\n    .setDescription(desc))\n\nnew Dispage()\n    .setEmbeds(embeds)\n    // This style will be given to every button that doesn't have a specific style\n    .setMainStyle('Secondary')\n    .editButton('previous', { emoji: \"824240081409540157\", label: \"Previous\" })\n    // Setting a property (here, style) to null will remove it. 👇\n    .editButton('stop', { emoji: \"961338862259544114\", label: null })\n    .editButton('next', { emoji: \"824240024509874186\", label: \"Next\" })\n    // We can edit as many buttons as we want and as many times as we wish\n    .editButton('stop', { style : \"Success\" })\n    // You can create your own custom button\n    .addButton({\n        label: \"Go to Message\",\n        style: \"Link\",\n        url: \"https://discord.com/channels/937626764916719626/937633296878293002/978956060972974101\"\n    })\n    // Finally after having setup everything. We can start\n    .start(message)\n```\n\n![Page 1](https://iili.io/XnAgvR.png)\n![Page 2](https://iili.io/XnAUYv.png)\n\n## Properties\n\u003e Instead of (for example) setting `index` to 1 by hand. Use the build-in (`setIndex`) method. Same for `embeds` (.setEmbeds), `ended` (.end()), duration (.setDuration) etc..\n\n| **Property**  | **Type**                                  | **Default Value**        |\n| ------------- | ----------------------------------------- | ------------------------ |\n| `client`      | `Client`                                  | `null`                   |\n| `index`       | `number`                                  | `0`                      |\n| `embeds`      | `Embed[]`                                 | `[]`                     |\n| `message`     | `Message`                                 | `null`                   |\n| `interaction` | `Interaction`                             | `null`                   |\n| `collector`   | `InteractionCollector\u003cButtonInteraction\u003e` | `null`                   |\n| `reply`       | `Message`                                 | `null`                   |\n| `ended`       | `boolean`                                 | `false`                  |\n| `started`     | `boolean`                                 | `false`                  |\n| `deleted`     | `boolean`                                 | `false`                  |\n| `duration`    | `number`                                  | `60000`                  |\n| `mainStyle`   | `MessageButtonStyle`                      | `\"PRIMARY\"`              |\n| `buttons`     | `MessageButtonOptions[]`                  | `MessageButtonOptions[]` |\n\n## Methods\n\u003e On the `Return` column, `this` means that the methode returns the original instance of the class. Like discord.js's MessageEmbed where we can call multiple times multiple methods following themselves. Like this: `new Dispage().setMainStyle('SECONDARY').setIndex(2)` etc..\n\n**__*PS*__: ⚠ MEANS __[DEPRECATED]__ (Meaning you shouldn't use it anymore)**\n\n|       **Name**        |         **Arguments**          |         **Return**         |\n| :-------------------: | :----------------------------: | :------------------------: |\n|    `setMainStyle`     |      `MessageButtonStyle`      |           `this`           |\n| `showDisabledButtons` |           `boolean`            |           `this`           |\n|     `removeUser`      |             `User`             |           `this`           |\n|       `addUser`       |             `User`             |           `this`           |\n|       `setUser`       |             `User`             |           `this`           |\n|      `addButton`      |     `MessageButtonOptions`     |           `this`           |\n|    `removeButton`     |            `string`            |           `this`           |\n|     `editButton`      | `string, MessageButtonOptions` |           `this`           |\n|       `getRows`       |           `boolean`            |    `MessageActionRow[]`    |\n|      `setEmbeds`      |           `Embed[]`            |           `this`           |\n|      `addEmbed`       |            `Embed`             |           `this`           |\n|      `addEmbeds`      |           `Embed[]`            |           `this`           |\n|     `_fixEmbeds`      | `Embed[] / Embed / Embed[][]`  |         `Embed[]`          |\n|     `setDuration`     |            `number`            |           `this`           |\n|     `addDuration`     |            `number`            |           `this`           |\n|        `next`         |               ❌                |      `Promise\u003cthis\u003e`       |\n|      `previous`       |               ❌                |      `Promise\u003cthis\u003e`       |\n|    `changeToPage`     |            `number`            |     `Promise\u003cMessage\u003e`     |\n|   `doesIndexExist`    |            `number`            |         `boolean`          |\n|      `setIndex`       |            `Number`            |           `this`           |\n|        `edit`         |      `MessageEditOptions`      | `Promise\u003cDiscord.Message\u003e` |\n|   `disableButtons`    |               ❌                |           `void`           |\n|         `end`         |               ❌                |           `void`           |\n|       `delete`        |               ❌                |           `void`           |\n|       `update`        |               ❌                |           `void`           |\n|       `getOpts`       |           `Boolean`            |      `MessageOptions`      |\n|      `isMessage`      |               ❌                |         `boolean`          |\n|    `isInteraction`    |               ❌                |         `boolean`          |\n|       `canEdit`       |               ❌                |         `boolean`          |\n|     `isValidCtx`      |           `Context`            |         `boolean`          |\n|   `checkForErrors`    |           `Context`            |         `string[]`         |\n|        `start`        |           `Context`            |      `Promise\u003cthis\u003e`       |\n\n## Trouble\nHaving a problem using \u003ca href=\"https://npmjs.com/package/dispage\"\u003e**dispage**\u003c/a\u003e ? Open an \u003ca href=\"https://github.com/voxlinou1/dispage/issues\"\u003eissue\u003c/a\u003e on \u003ca href=\"https://github.com/voxlinou1/dispage\"\u003eGithub\u003ca\u003e \u0026 Don't hesitate to send a message to the discord tag below 👇 !\n\n## Credits\nMade by voxlinou1 (*`Vox#6198`* on discord)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbimoware%2Fdispage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbimoware%2Fdispage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbimoware%2Fdispage/lists"}