embedbuilder undefined?

so uhm it says that embedbuilder is not defined.
let response = '';
const embed = new EmbedBuilder()
.setColor('#AC00FF')
.setTitle('Top Nation')
let ind = 0
let da = Object.keys(bdata).map(key => {
return { id: key, ...bdata[key] };
});

da.sort((a, b) => b.power - a.power);

Promise.all(da.map(item => client.users.fetch(item.id)))
.then(users => {
if (ind <= 10) {
da.forEach((item, index) => {
ind += 1
item.username = users[index].username;
});
da.forEach((item, index) => {
response += `\n${index +1} > ${item.nation} - (${item.power - 20} - ${item.power + 20}) - (${item.cash - 20} - ${item.cash + 20}) - (${item.username})`;
});
}
embed.setDescription(response)
interaction.reply({embeds: [embed]});
})
.catch(error => {
console.error('Err:', error);
interaction.reply('Error');
});
let response = '';
const embed = new EmbedBuilder()
.setColor('#AC00FF')
.setTitle('Top Nation')
let ind = 0
let da = Object.keys(bdata).map(key => {
return { id: key, ...bdata[key] };
});

da.sort((a, b) => b.power - a.power);

Promise.all(da.map(item => client.users.fetch(item.id)))
.then(users => {
if (ind <= 10) {
da.forEach((item, index) => {
ind += 1
item.username = users[index].username;
});
da.forEach((item, index) => {
response += `\n${index +1} > ${item.nation} - (${item.power - 20} - ${item.power + 20}) - (${item.cash - 20} - ${item.cash + 20}) - (${item.username})`;
});
}
embed.setDescription(response)
interaction.reply({embeds: [embed]});
})
.catch(error => {
console.error('Err:', error);
interaction.reply('Error');
});
2 Replies
d.js toolkit
d.js toolkit5mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
D4v1D
D4v1DOP5mo ago
No description
Want results from more Discord servers?
Add your server