Comments (12)
I missed the opportunity to ask this: What Discord.JS version are you using? I can only assume right now [according to the source code] that you're using the master version (v12) of D.JS, which installing v11
branch is not an option and instead install the master branch. Also recently, .setAuthorizedUser(<user>)
has been changed to .setAuthorizedUsers(<array of user ids>)
at master branch.
For more change notes: Click me or refer to the updated docs
from discord-paginationembed.
Hi. I've tested v11 branch and there are no problems encountered with my test script. Perhaps showing your source code will help?
from discord-paginationembed.
const { Embeds: EmbedsMode, FieldsEmbed: FieldsEmbedMode } = require('discord-paginationembed');
module.exports = {
name: 'pokemon',
aliases: ['p'],
description: 'Pokemon List',
cooldown: 1,
async execute(prefix, command, message, args, db) {
db.query("SELECT *, user_monsters.ID FROM user_monsters JOIN monsters ON user_monsters.monster_ID = monsters.ID WHERE user_ID='" + message.author.id + "' ORDER BY seq_num;",async function(err,rows){
if(err) throw err;
if(rows != null && rows.length > 0){
var pagenum = 1;
if(!isNaN(parseInt(args[0]))) pagenum = args[0];
var pages = [];
var listpage = '';
rows.forEach((row) => {
var iv = (Math.floor(((row.attiv + row.defiv + row.hpiv + row.speediv + row.spattiv + row.spdefiv) / 6) * 100));
var pokerow = (row.shiny != 1 ? '' : '__✨__ ') + '# ' + row.seq_num + ' **' + row.name + '** | IV: ' + iv + '% | Lvl: ' + Math.floor((1/58) * (Math.sqrt(29) * Math.sqrt(8 * row.xp + 29) - 29)) + '\n';
if((pokerow.length + listpage.length) > 725){
pages.push(listpage);
listpage = pokerow;
}else{
listpage += pokerow;
}
});
pages.push(listpage);
if(pagenum > pages.length) pagenum = 1;
const embeds = [];
var i = 0;
pages.forEach((page) => {
i++;
const exampleEmbed = new Discord.MessageEmbed()
.setThumbnail(message.author.displayAvatarURL)
.setColor('#0099ff')
.setTitle(message.author.username + '\'s Pokemon')
.addField('Pokemon List', pages[i - 1])
.setFooter("Showing page " + i + " of " + pages.length + ". Use `" + prefix + command + " <number>` to show a new page or use the emojis below.");
embeds.push(exampleEmbed);
});
var neb = new EmbedsMode().setArray(embeds)
.setAuthorizedUser(message.author)
.setClientMessage(null, message.author.toString())
.setChannel(message.channel)
.showPageIndicator(false)
.setPage(pagenum)
.setColor(3447003);
return await neb.build();
///node_modules/discord.js/src/structures/MessageEmbed.js:157if (value.length > 1024) throw new RangeError('MessageEmbed field values may not exceed 1024 characters.');
}else{
message.reply("You don't have any pokemon!");
}
});
}
};
This is one of my commands i think fixing this one I will be able to do the rest because they are basically the same setup.. I have tried putting in the RichEmbed and that isnt working either @gazmull
from discord-paginationembed.
now getting a new error for RichEmbed
Even after adding the RichEmbed it still likes to play with me hahaha
from discord-paginationembed.
So the master branch would be which npm install.. We use node.js
from discord-paginationembed.
npm install gazmull/discord-paginationembed#v11
Is this not the one i should be using?
from discord-paginationembed.
Yes. gazmull/discord-paginationembed#v11
is only for D.JS 11.3.2 and below.
from discord-paginationembed.
Thats the one i have and its throwing the RichEmbed error
from discord-paginationembed.
Are you sure your D.JS Version is v11.3.2 or below? It seems your source code says otherwise with new Discord.MessageEmbed()
— or do you happen to really use MessageEmbed
instead of RichEmbed
for declaring a new instance of an embed?
The only thing I could think of, if ever the question above doesn't solve anything, is re-installing Discord.JS.
from discord-paginationembed.
MessageEmbed is whats used on all my commands and I'm not sure which version I'm using for discord.js to be honest
from discord-paginationembed.
I download discord.js about 6 weeks ago
from discord-paginationembed.
Please refer to npm ls discord.js
.
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
- Cannot use Homogeneous Arrays HOT 3
- 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.