menuPages
An Embed paginator using Select Menus
Program
- Javascript
- Typescript
const simplydjs = require("simply-djs");
import simplydjs from "simply-djs";
simplydjs.menuPages(interaction, {
data: [
{...}
], // array of data objects (required)
// options (Optional)
})
Output
Arguments:
simplydjs.menuPages(
interaction: Discord.Message | Discord.CommandInteraction,
options: menuEmbOptions
)
- interaction:
Discord.Message
|Discord.CommandInteraction
- options:
menuEmbOptions
Options menuEmbOptions
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
type | 1 (or) 2 | ❌ | 1 | The type of menuPage. (1 for ephemeral reply & 2 for editing message) |
rows | MessageActionRow[] | ❌ | none | Add custom rows to the message |
embed | MessageEmbed | ✅ | none | The embed of your message that is sent with the select menu |
delete | deleteOpt | ❌ | default object | The data object for the custom delete menu option |
data | dataObj[] | ✅ | none | The data necessary to create the pages. (Array of dataObj) |
placeHolder | string | ❌ | 'Dropdown pages' | Placeholder of the select menu |
dataObj option
dataObj
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
label | string | ✅ | none | The label of the option |
desc | string | ✅ | none | The description of the option |
embed | MessageEmbed | ✅ | none | The embed of your message when the option is selected |
emoji | string | ✅ | none | The emoji of the option |