I want to abbreviate numbers, but I don't know how, here is my balance code:
bot.on(`message`, async (message) => {
let cur = await db.fetch(`currency_${message.guild.id}`)
if (cur === null) cur = nocur
let cash = cur;
if (message.content.startsWith(prefix + "bal" || prefix + "balance")) {
if (economy === false) return message.channel.send("The `economy` feature is currently `off` make `" + prefix + "economy <on/off>` to switch")
if (economy === true) {
let member = message.mentions.members.first()
if (!member) {
let points = await db.fetch(`money_${message.guild.id}_cash_${message.author.id}`)
if (points === null) points = 0
message.channel.send("<@" + message.author.id + "> has `" + points + "` " + cash + ".")
}
if (member) {
let points = await db.fetch(`money_${message.guild.id}_cash_${member.id}`)
if (points === null) points = 0
if (points === null) {
message.channel.send("<@" + member + "> has `0` " + cash + ".")
} else {
message.channel.send("<@" + member + "> has `" + points + "` " + cash + ".")
}
}
}
}
})