Confirm money transfer

const db = require(“quick.db”)
const { MessageEmbed } = require(“discord.js”);
module.exports = {
name: “money”,
aliases: [“bal”, “balance”],
category: “economy”,
description: “Vezi balanta cuiva./ Transfera bani.”,
run: async (client, message, args) => {

 if(!args[0])  {

  let bal = db.get(`money_${message.author.id}`)

if (bal === null) bal = 0;

return message.channel.send(**${message.author.username}, ai o balanta de ${bal } | :money_with_wings:.**)
}
if(!args[1]) {
const user = message.mentions.members.first() || message.guild.members.cache.get(args[0])

  let bal = db.get(`money_${user.id}`)

if (bal === null) bal = 0;

return message.channel.send(**${message.author.username}, ${user.user.username} are o balanta de ${bal} | :money_with_wings:.**)
}

  const user = message.mentions.members.first() || message.guild.members.cache.get(args[0])
      let member = db.get(`money_${message.author.id}`)

if (!user) {
return message.channel.send(’<a:nu:735929441980514346> | Nu am putut gasi acel utilizator.’)
}
if (!args[1]) {
return message.channel.send(’<a:nu:735929441980514346> | Trebuie sa specifici suma.’)
}
if (message.content.includes(’-’) || message.content.includes(’.’) || message.content.includes(’,’)|| args[1] == “0” || isNaN(args[1])) {
return message.channel.send(’<a:nu:735929441980514346> | Introdu o suma valida de bani.’)
}

if (member < args[1]) {
    return message.channel.send('<a:nu:735929441980514346>|  Nu ai atatia bani.') 
}

  if(user.id == message.author.id) {

return message.channel.send(<a:nu:735929441980514346> | Nu-ti poti transfera bani singur.)
}
if(args[1] < 10 ){
return message.channel.send(<a:nu:735929441980514346> | Nu poti transfera mai putin de 10 <a:bani:736126779181367318>.)

}
let bal1 = db.get(money_${user.id})
let paidMoney = (85 / 100 ) * args[1]

db.add(money_${user.id}, paidMoney)
db.subtract(money_${message.author.id}, args[1])
let bal2 = db.get(money_${user.id})
let gotmoney = bal2 - bal1

message.channel.send(**${message.author.username}, ${args[1]} <a:bani:736126779181367318> au fost extrasi din balanta ta.**)
user.send(**Ai primit ${gotmoney} <a:bani:736126779181367318> de la ${message.author.username} (ID: \${message.author.id}`).**`)

}
}

Do you need help with something?

1 Like

yes i want after he types o?money to ask him if he is sure

Then listen for a response

1 Like