Comments (3)
You could create a new array of objects with both the title and link by looping through the links
and accessing the value of names
on the same index or vise versa.
const names = ["DuckDuckGo", "Discord", "GitHub"];
const links = [
"https://duckduckgo.com",
"https://discord.com",
"https://github.com",
];
const names_with_links = names.map((name, i) => ({ name, link: links[i] }));
console.log(names_with_links);
// OUTPUT: [{ name: "DuckDuckGo", link: "https://duckduckgo.com" }, ...];
And then modify the function in .formatField
appropriately.
const FieldsEmbed = new Pagination.FieldsEmbed()
.setArray(names_with_links)
.setChannel(message.channel)
.formatField("LINK", (elem) => `[CLICK HERE TO ${elem.name}](${elem.link})`);
from discord-paginationembed.
Try to do it this way
const test = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
const FieldsEmbed = new Pagination.FieldsEmbed()
.setArray(test)
.setAuthorizedUsers([message.author.id])
.setChannel(message.channel)
.formatField('Numbers' , n => n)
.setElementsPerPage(2);
FieldsEmbed.build();
from discord-paginationembed.
Thank you! Worked fine!
Can you help me with another thing?
I Have an API that return two different arrays like links[] and names[]. I`d like to know if it is possible build an embed to show like CLICK HERE TO 1, CLICK HERE TO 2...
If yes, how can I do this.
This image shows how can I need. But instead "Test" I need the names that are saved on other array.
from discord-paginationembed.
Related Issues (20)
- Why is there only a way to delete function emojis?
- Get message object? HOT 3
- Jump message edit Error HOT 5
- Embed Data stacks HOT 1
- Embed is not showing HOT 6
- I dont know how to add our help command pages of different categories in pages,page-1:info commands,page-2:mod commands...i want to set like this please help me to set an array with description
- I do not know how to change thumbnails for each page, can someone help me out on this? HOT 1
- UnhandledPromiseRejectionWarning: TypeError: Right-hand side of 'instanceof' is not an object HOT 1
- Cannot use custom server emojis in setNavigationEmojis() HOT 6
- Option for error message in jumping pages by input
- Disabling jump navigation emoji isn't enough to send paginated embed without MANAGE_MESSAGES HOT 4
- Emoji Reactions not responding HOT 1
- addFields() bug!?
- error TS2611: 'pages' is defined as a property HOT 1
- this.clientAssets.prompt.replace is not a function HOT 1
- Change the jump message HOT 1
- weird display bug ?? HOT 1
- FieldsEmbed Mode Not Working at DJSv13 HOT 2
- discord v13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from discord-paginationembed.