How can i send a Pagination-embed with a music list discord.js

Zarcross

I want send in a Pagination-embed with a music list because whan an embed is lower at 1024 letters it doesn't send. I want send in many pages (4musics max per pages)

Sorry for my english, i'm french...

  console.log(_serverQueue.songs)
  let q = ``;
  for(var i = 1; i < _serverQueue.songs.length; i++) {
      q += `\n${i + 1}. **${_serverQueue.songs[i].title}**`;
  }
  let resp = [
      {name: `Now Playing`, value: _serverQueue.songs[0].title},
      {name: `Queue`, value: q},
  ];

  //Putting it all together
  const FieldsEmbed = new Pagination.FieldsEmbed()
  .setArray({word: `Queue`})
  .setAuthorizedUsers([message.author.id])
  .setChannel(message.channel)
  .setElementsPerPage(4)
  .setPageIndicator(true)
  .formatField('Playlist :', el => el.word)
  FieldsEmbed.embed
    .setColor('#008000')
    .setTitle('Playlist :')
    FieldsEmbed.build()
}
PLASMA chicken

As per the Documentation of https://www.npmjs.com/package/discord-paginationembed

I explained the steps with Comments

const Discord = require('discord.js');
const Pagination = require('discord-paginationembed');

const songText = ["This is a long SongText", "That is Split up Over", "Multiple Sites", "End of Song"];
// The Splitting can happen via Discord.Js Util Class, it has a Splitter

const embeds = [];
 
for (let i = 1; i <= 4; ++i)
  embeds.push(new Discord.MessageEmbed().setFooter('Page ' + i).setDescription(songText[i - 1]));
 // Create Embeds here with the Content and push them into the Array

const myImage = message.author.displayAvatarURL();
 
new Pagination.Embeds()
  .setArray(embeds)
  .setAuthorizedUsers([message.author.id])
  .setChannel(message.channel)
  .setPageIndicator(true)
  .setPage(1)
   // Methods below are for customizing all embeds
  .setImage(myImage)
  .setThumbnail(myImage)
  .setTitle('Test Title')
  .setDescription('Test Description')
  .setURL(myImage)
  .setColor(0xFF00AE)
  .build();

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

how can i embed python in c?

From Dev

Wordpress - How can I enable pagination on template?

From Dev

How can i send a webcal request with node.js?

From Dev

How can I do pagination with Bluebird Promises?

From Dev

How i can enable WordPress Posts Pagination

From Dev

Can I pass a list to PyGame Music?

From Dev

How can I stop music with a push button?

From Dev

Can I implement pagination in Vaadin? If yes then how?

From Dev

How can I leverage builtin pagination for a list_route in the Django Rest Framework?

From Dev

How do I embed a facebook send button in my react app?

From Dev

how can i make my discord.py bot send a message i choose to a channel i choose?

From Dev

How do I send a message to a specific channel in discord.js?

From Dev

Discord.js embed command

From Dev

How can I pause music on click?

From Dev

How can I implement a !leaveguild <guildID> command (that leaves the specified guild) into my Discord (discord.js) bot?

From Dev

How can I send an image from an API from a Discord bot?

From Dev

How to send message with discord.js with ID

From Dev

How can I get 3 user mentions? - discord-js

From Dev

How can I prevent audiobooks from appearing in Banshee's 'Music' list

From Dev

How can I play music?

From Dev

How can I embed a simple, type JSON, web service into my website using JS

From Dev

How can I send a list of array to parse and retrieve it and show it in a UItableView?

From Dev

How can I embed subtitles into videos with ffmpeg?

From Dev

how i can write a function in node js (get) and send data

From Dev

How would i send a song index to a custom music Player?

From Dev

How can I change the default music player?

From Dev

How can I embed React element into component?

From Dev

How do I send a message without using the deprecated way "sendMessage" in discord.js?

From Dev

How can I include Pagination in my table.js page?

Related Related

  1. 1

    how can i embed python in c?

  2. 2

    Wordpress - How can I enable pagination on template?

  3. 3

    How can i send a webcal request with node.js?

  4. 4

    How can I do pagination with Bluebird Promises?

  5. 5

    How i can enable WordPress Posts Pagination

  6. 6

    Can I pass a list to PyGame Music?

  7. 7

    How can I stop music with a push button?

  8. 8

    Can I implement pagination in Vaadin? If yes then how?

  9. 9

    How can I leverage builtin pagination for a list_route in the Django Rest Framework?

  10. 10

    How do I embed a facebook send button in my react app?

  11. 11

    how can i make my discord.py bot send a message i choose to a channel i choose?

  12. 12

    How do I send a message to a specific channel in discord.js?

  13. 13

    Discord.js embed command

  14. 14

    How can I pause music on click?

  15. 15

    How can I implement a !leaveguild <guildID> command (that leaves the specified guild) into my Discord (discord.js) bot?

  16. 16

    How can I send an image from an API from a Discord bot?

  17. 17

    How to send message with discord.js with ID

  18. 18

    How can I get 3 user mentions? - discord-js

  19. 19

    How can I prevent audiobooks from appearing in Banshee's 'Music' list

  20. 20

    How can I play music?

  21. 21

    How can I embed a simple, type JSON, web service into my website using JS

  22. 22

    How can I send a list of array to parse and retrieve it and show it in a UItableView?

  23. 23

    How can I embed subtitles into videos with ffmpeg?

  24. 24

    how i can write a function in node js (get) and send data

  25. 25

    How would i send a song index to a custom music Player?

  26. 26

    How can I change the default music player?

  27. 27

    How can I embed React element into component?

  28. 28

    How do I send a message without using the deprecated way "sendMessage" in discord.js?

  29. 29

    How can I include Pagination in my table.js page?

HotTag

Archive