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 🙏

© 2024 – Pkg Stats / Ryan Hefner

paginated.embed

v0.0.4

Published

The best module to add page embed to your Discord bot!

Downloads

14

Readme

📖 Paginated.Embed - Discord Paginated Embed Module

You create a paginated embed.

🔧 Installation

  • You can download paginated.embed in powershell with this code.
npm install paginated.embed
  • For Paginated.Embed to work, you need to use the discord.js module above @14.
npm upgrade discord.js

🧱 Basic Usage

Below are examples for you to create a paginated embed. You cannot make customizations other than the customizations mentioned below. And if you want to do version control automatically, we have extra code.

Check Update

  • Code:
const { checkUpdate } = require("paginated.embed")

client.on("ready", async() => {

    await checkUpdate()
    
})
  • Result if the module is out of date (Automatically logs to the console.):
Paginated.Embed is out of date! Remember to use "npm update Paginated.Embed" ( Old Version -> New Version ) in powershell to take advantage of the new features.

Example Interaction Usage

  • Code:
const { Paginator } = require("paginated.embed")
const { SlashCommandBuilder } = require("@discordjs/builders");

module.exports = {
    data: new SlashCommandBuilder()
    .setName("paginated-embed")
    .setDescription("Generates paginated embed!"),
    run: async (client, interaction) => {

        await interaction.deferReply()

        const paginator = new Paginator()
        .addStrings([
            {author: { name: "Paginated Embed!" }, description: "This is the 1st test message."}, 
            {author: { name: "Paginated Embed!" }, description: "This is the 2nd test message."}, 
            {author: { name: "Paginated Embed!" }, description: "This is the 3rd test message."}
        ])
        .setButtons({
            firstPage: { label: "Go First Page" }, 
            previous: { label: "Previous", style: Discord.ButtonStyle.Success }, 
            next: { label: "Next", style: Discord.ButtonStyle.Success }, 
            lastPage: { label: "Go Last Page" }
        })
        .setEmbedColor("Blurple")
        .setTimestamp()

        await paginator.create(interaction, Paginator.Type.InteractionEditReply)
        // Paginator.Type.InteractionReply | Paginator.Type.InteractionEditReply | Paginator.Type.InteractionFollowUp | Paginator.Type.InteractionChannelSend

} 
}

Example Message Usage

  • Code:
const { Paginator } = require("paginated.embed")

client.on("messageCreate", async(message) => {

    if(message.content == "paginator") {

        const paginator = new Paginator()
        .addStrings([
            {author: { name: "Paginated Embed!" }, description: "This is the 1st test message."}, 
            {author: { name: "Paginated Embed!" }, description: "This is the 2nd test message."}, 
            {author: { name: "Paginated Embed!" }, description: "This is the 3rd test message."}
        ])
        .setButtons({
            firstPage: { label: "Go First Page" }, 
            previous: { label: "Previous", style: Discord.ButtonStyle.Success }, 
            next: { label: "Next", style: Discord.ButtonStyle.Success }, 
            lastPage: { label: "Go Last Page" }
        })
        .setEmbedColor("Blurple")
        .setTimestamp()

        await paginator.create(message, Paginator.Type.MessageChannelSend)
        // Paginator.Type.Reply | Paginator.Type.MessageChannelSend

    }

})

All Customizability

  • Code:
const { Paginator } = require("paginated.embed")

client.on("messageCreate", async(message) => {

    if(message.content == "paginator") {

        const paginator = new Paginator()
        .addStrings([
            { author: { name: "Paginated Embed!", iconURL: `https://cdn.discordapp.com/emojis/1249062572758663419.png` }, description: "This is the 1st test message.", thumbnail: "https://r.resimlink.com/MHq9U.png", footer: { text: "Hi", iconURL: "https://r.resimlink.com/MHq9U.png" } }, 
            { author: { name: "Paginated Embed!" }, title: "Hi!", url: "https://discord.gg/TCWbk7zWY5", description: "This is the 2nd test message.", image: "https://r.resimlink.com/MHq9U.png", thumbnail: "https://r.resimlink.com/MHq9U.png" }, 
            { author: { name: "Paginated Embed!", url: "https://discord.gg/TCWbk7zWY5" }, description: "This is the 3rd test message.", fields: [ { name: "Test Field", value: "Hi!", inline: true } ] }
        ])
        // All options in one: ([ { author: { name: string, iconURL: string }, title: string, url: string, description, fields: [ { name: string, value: string, inline: boolean } ], image: string, footer: { text: string, iconURL: string } }, {...}, {...} ])
        // You can use {currentPage} or {totalPage} in the footer section.
        .setButtons({
            firstPage: { label: "Go First Page", emoji: "1216013763933896804", style: Discord.ButtonStyle.Danger }, 
            previous: { label: "Previous", emoji: "1216013763933896804", style: Discord.ButtonStyle.Primary }, 
            next: { label: "Next", emoji: "1216013763933896804", style: Discord.ButtonStyle.Secondary }, 
            lastPage: { label: "Go Last Page", emoji: "1216013763933896804", style: Discord.ButtonStyle.Success }
        })
        .setEmbedColor("Blurple")
        // What you can use in the setColor section when creating Discord embed is also valid here.
        .setTimestamp()
        // Delete it or leave it, you don't need to put anything in ().

        await paginator.create(message, Paginator.Type.MessageChannelSend)
        // Remember to set Paginator.Type according to Interaction or Message.

    }

})

✨ Support

You can come to our Discord server and get help and support on #npm-support channel. Or if you send a friend to my discord account, I will return as soon as possible.

📜 License

This project is licensed under the MIT License - see the LICENSE file for details.