Coder Social home page Coder Social logo

Comments (4)

gazmull avatar gazmull commented on June 15, 2024

Hello and thanks for using this module! May I know how's the code? It'll help a lot to troubleshoot this problem. Thanks.

from discord-paginationembed.

wissehes avatar wissehes commented on June 15, 2024

Hi there, I am using it for my help command

    var help1 = new Discord.RichEmbed()
    .addField(`${prefix}meme`, `Sends a random meme related to The Trio`)
    .addField(`${prefix}BadBoyHalo`, `Sends a random meme related to BadBoyHalo`)
    .addField(`${prefix}braincells`, `Sends the number of your braincells`)
    .addField(`${prefix}Candad`, `Sends information about Candad`)
    .addField(`${prefix}chicken`, `Sends a random picture of a chicken`)
    .addField(`${prefix}pinecone`, `pinecone`)
    .addField(`${prefix}ping`, `Gives the ping of the bot`)
    .addField(`${prefix}pingspoof`, `I think you know what this is`)
    .addField(`${prefix}sotp`, `sotp`)
    .addField(`${prefix}say`, `Make Skeppy say whatever you want!`)
    .addField(`${prefix}latest video`, `Shows the latest video of the channel you specify!`)
    .addField(`${prefix}latest tweet`, `Shows skeppy's latest tweet`)
    new Pagination.Embeds()
    .setArray([help1])
    .setDeleteOnTimeout(true)
    .setAuthorizedUsers([message.author.id])
    .setChannel(message.channel)
    .setPageIndicator(true)
    .setElementsPerPage(1)
    
 .setThumbnail("https://pbs.twimg.com/profile_images/1182235859036332033/bkU06kE__400x400.jpg")
    .setFooter("Made by TheChicken#5845")
    .setURL('https://github.com/thechicken14/skeppy-bot')
    .setColor(4285916)
    .build();

from discord-paginationembed.

gazmull avatar gazmull commented on June 15, 2024

From what I see, you're trying to paginate each field in help1. While your choice of mode (Embeds mode) is perfect for this case, the way you wrote it is quite wrong.

setElementsPerPage method is only for FieldsEmbed mode (this should not be suggested by your IDE while using Embeds modeβ€” that is if you're using an IDE) because Embeds mode does display a RichEmbed instance per page already.

As for the fields in that single RichEmbed instance, I'd like to recommend to create an instance of RichEmbed per field to make it work like you wanted (according to what I can read from the source code) and proper for Embeds mode. For example:

// Make an array of RichEmbed instances and per instance add the field, via Array.prototype.map()
const commands = [
  [ `${prefix}meme`, `Sends a random meme related to The Trio` ],
  [ `${prefix}BadBoyHalo`, `Sends a random meme related to BadBoyHalo` ]
].map(field => new Discord.RichEmbed().addField(field[0], field[1]));

// Applying it to Embeds mode
const Embeds = new Pagination.Embeds()
  .setArray(commands)
  .setDeleteOnTimeout(true)
  .setAuthorizedUsers([message.author.id])
  .setChannel(message.channel)
  .setPageIndicator(true)
 
 .setThumbnail("https://pbs.twimg.com/profile_images/1182235859036332033/bkU06kE__400x400.jpg")
  .setFooter("Made by TheChicken#5845")
  .setURL('https://github.com/thechicken14/skeppy-bot')
  .setColor(4285916);

Embeds.build();

from discord-paginationembed.

gazmull avatar gazmull commented on June 15, 2024

Assuming issue solved.

from discord-paginationembed.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.