So I am making an economy bot and I reverted my quick.db version to 6.3.2 so my leaderboard could work and now my balance and things of that sort now just don’t work, were the number/amount of coins is now displayed as “[object Promise]”.
If anything could someone help me making this code:
const Discord = require(‘discord.js’)
const db = require(‘quick.db’)
module.exports.run = async (bot, message, args) => {
if(!message.content.startsWith(’/’))return;
let kids = db.startsWith(kids
, { sort: ‘.data’}).then(resp => {
resp.length = 10;
var finalLb = “”;
var i = 0;
let indexnum = 0;
for (i in resp) {
finalLb += **${++indexnum}. <@${bot.users.get(resp[i].ID.split('_')[1]).id}>** - ${resp[i].data} :dollar:\n
;
}
const embed = new Discord.RichEmbed()
.setAuthor(`Leaderboard!`, message.guild.iconURL)
.setColor(message.member.displayHexColor)
.setDescription(finalLb)
.setFooter(bot.user.tag, bot.user.displayAvatarURL)
.setTimestamp()
message.channel.send(embed)
})
}
module.exports.help = {
name: “leaderboard”,
aliases: [“lb”]
};
Compatible with quick.db 7.1.1, if you can I thank you so much.
Thanks for reading my problem