do you know what’s wrong with the code? i use ".id "in all over my codes, but this want is not working , any solution?
case 'rob':
let userrob = message.mentions.members.first()
let targetuser = db.fetch(`money_${message.guild.id}_${userrob.id}`)
let authorrob = db.fetch(`rob_${message.guild.id}_${userrob.id}`)
let authorrob2 = db.fetch(`money_${message.guild.id}_${userrob.id}`)
let timeoutrob = 600000;
if (authorrob !== null && timeoutrob - (Date.now() - authorrob) > 0) {
let timerob = ms(timeoutrob - (Date.now() - authorrob));
let timeEmbedrob = new Discord.MessageEmbed()
.setColor("#FFFFFF")
.setDescription(`:x: You have already robbed someone\n\nTry again in ${timerob.minutes}m ${timerob.seconds}s `);
message.channel.send(timeEmbedrob)
} else {
let moneyEmbedrob = new Discord.MessageEmbed()
.setColor("#FFFFFF")
.setDescription(`:x: You need atleast 200 coins in your wallet to rob someone`);
if (authorrob2 < 200) {
return message.channel.send(moneyEmbedrob)
}
let moneyEmbedrob2 = new Discord.MessageEmbed()
.setColor("#FFFFFF")
.setDescription(`:x: ${userrob.user.username} does not have anything you can rob`);
if (targetuser < 0) {
return message.channel.send(moneyEmbedrob2)
}
let viprob = db.fetch(`bronze_${userrob.id}`)
if(viprob === true) random = Math.floor(Math.random() * 500) + 300;
if (viprob === null) random = Math.floor(Math.random() * 100) + 300;
let embedrob = new Discord.MessageEmbed()
.setDescription(`:white_check_mark: You robbed ${userrob} and got away with ${random} coins`)
.setColor("#FFFFFF")
message.channel.send(embedrob)
db.subtract(`money_${message.guild.id}_${userrob.id}`, random)
db.add(`money_${message.guild.id}_${userrob.id}`, random)
db.set(`rob_${message.guild.id}_${userrob.id}`, Date.now())
};