rpg-add.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. let handler = async (m, { conn, command, text }) => {
  2. if (command == 'añadirdiamantes' || command == 'dardiamantes' || command == 'addlimit') {
  3. const pajak = 0;
  4. let who;
  5. if (m.isGroup) who = m.mentionedJid[0];
  6. else who = m.chat;
  7. if (!who) return m.reply(`⚠️ etiqueta a una persona con el @tag`)
  8. const txt = text.replace('@' + who.split`@`[0], '').trim();
  9. if (!txt) return m.reply(`⚠️ Ingresa la cantidad que desea agregar`)
  10. if (isNaN(txt)) return m.reply(`⚠️ Falta el Num`)
  11. const dmt = parseInt(txt);
  12. let limit = dmt;
  13. const pjk = Math.ceil(dmt * pajak);
  14. limit += pjk;
  15. if (limit < 1) return m.reply(`⚠️ No tiene `)
  16. const users = global.db.data.users;
  17. users[who].limit += dmt;
  18. m.reply(`*≡ 💎 SE AGREGADO:*
  19. ┏╍╍╍╍╍╍╍╍╍╍╍╍╍
  20. ┃• *𝗍᥆𝗍ᥲᥣ:* ${dmt}
  21. ┗╍╍╍╍╍╍╍╍╍╍╍╍╍`)}
  22. if (command == 'añadirxp' || command == 'addexp' || command == 'addxp') {
  23. const pajak = 0;
  24. let who;
  25. if (m.isGroup) who = m.mentionedJid[0];
  26. else who = m.chat;
  27. if (!who) return m.reply(`⚠️ etiqueta a una persona con el @tag`)
  28. const txt = text.replace('@' + who.split`@`[0], '').trim();
  29. if (!txt) return m.reply(`⚠️ Ingresa la cantidad que desea agregar`)
  30. if (isNaN(txt)) return m.reply(`⚠️ Falta el Num`)
  31. const xp = parseInt(txt);
  32. let exp = xp;
  33. const pjk = Math.ceil(xp * pajak);
  34. exp += pjk;
  35. if (exp < 1) return m.reply(`⚠️ Se `)
  36. const users = global.db.data.users;
  37. users[who].exp += xp;
  38. m.reply(`*≡ EXP AGREGADO:*
  39. ┏╍╍╍╍╍╍╍╍╍╍╍╍╍
  40. ┃• *𝗍᥆𝗍ᥲᥣ:* ${xp}
  41. ┗╍╍╍╍╍╍╍╍╍╍╍╍╍`)
  42. }}
  43. handler.help = ['addexp', 'addlimit']
  44. handler.tags = ['owner']
  45. handler.command = /^(añadirdiamantes|dardiamantes|addlimit|añadirxp|addexp|addxp)$/i
  46. handler.rowner = true
  47. handler.register = true
  48. export default handler