0

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 + ".")
                }
            }
        }

    }

})
player0
  • 99,092
  • 8
  • 51
  • 98
apey
  • 1
  • Yeah and how to make `message.channel.send("You have "+number+" cash!")` instead of return number; ? i use quick.db how to make it with quick.db, i mean: let bal = db.get(````cash_${message.author.id}````) bal.abbreviate //i don't know how to do it message.channel.send("You have "+bal+" cash!") //and than it sends the abbreviated balance – apey Apr 01 '22 at 21:06

0 Answers0