【发布时间】:2021-12-15 04:56:23
【问题描述】:
所以我有一种自制经济的东西,当我添加一个工作命令并且当它工作时它会选择一个随机数和东西但是当它将数字添加到旧货币时它添加就像 ex 123+123 = 123123 应该是 246 我不知道如何解决这个问题 我尝试了所有方法,但没有任何效果
if (message.content.toLowerCase().startsWith(prefixS.prefix + 'work')) {
const inventoryS = await inventory.findOne({ userID: message.author.id, guildID: message.guild.id });
if (inventoryS.item1 === 'true') {
const payment = Math.floor(Math.random() * 125) + 25;
inventoryS.currency += payment
inventoryS.save()
message.channel.send({ embeds: [new Discord.MessageEmbed().setTitle('After a long day of work your balance is').setDescription(`__Your balance__\n > Money: ${inventoryS.currency}`).setColor('BROWN')] })
}
}
【问题讨论】:
标签: mongodb mongoose discord.js