rpg-adel.js 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. let handler = async (m, { conn, command, text }) => {
  2. if (command == 'eliminardiamantes' || command == 'quitardiamantes' || command == 'dellimit') {
  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 eliminar`)
  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. // Verificar que no se eliminen más diamantes de los que tiene
  18. if (dmt > users[who].limit) {
  19. return m.reply(`⚠️ No puedes eliminar más diamantes de los que tiene.\n*Diamantes actuales:* ${users[who].limit}`)
  20. }
  21. users[who].limit -= dmt;
  22. m.reply(`*≡ 💎 SE ELIMINADO:*
  23. ┏╍╍╍╍╍╍╍╍╍╍╍╍╍
  24. ┃• *𝗍᥆𝗍ᥲᥣ:* ${dmt}
  25. ┃• *𝖣𝗂ᥲ𝗆ᥲ𝗇𝗍ᥱ𝗌 𝗋ᥱ𝗌𝗍ᥲ𝗇𝗍ᥱ𝗌:* ${users[who].limit}
  26. ┗╍╍╍╍╍╍╍╍╍╍╍╍╍`)}
  27. if (command == 'eliminarxp' || command == 'delexp' || command == 'delxp') {
  28. const pajak = 0;
  29. let who;
  30. if (m.isGroup) who = m.mentionedJid[0];
  31. else who = m.chat;
  32. if (!who) return m.reply(`⚠️ etiqueta a una persona con el @tag`)
  33. const txt = text.replace('@' + who.split`@`[0], '').trim();
  34. if (!txt) return m.reply(`⚠️ Ingresa la cantidad que desea eliminar`)
  35. if (isNaN(txt)) return m.reply(`⚠️ Falta el Num`)
  36. const xp = parseInt(txt);
  37. let exp = xp;
  38. const pjk = Math.ceil(xp * pajak);
  39. exp += pjk;
  40. if (exp < 1) return m.reply(`⚠️ Se `)
  41. const users = global.db.data.users;
  42. // Verificar que no se eliminen más XP de los que tiene
  43. if (xp > users[who].exp) {
  44. return m.reply(`⚠️ No puedes eliminar más XP de los que tiene.\n*XP actual:* ${users[who].exp}`)
  45. }
  46. users[who].exp -= xp;
  47. m.reply(`*≡ EXP ELIMINADO:*
  48. ┏╍╍╍╍╍╍╍╍╍╍╍╍╍
  49. ┃• *𝗍᥆𝗍ᥲᥣ:* ${xp}
  50. ┃• *𝖷𝖯 𝗋ᥱ𝗌𝗍ᥲ𝗇𝗍ᥱ:* ${users[who].exp}
  51. ┗╍╍╍╍╍╍╍╍╍╍╍╍╍`)
  52. }}
  53. handler.help = ['delexp', 'dellimit']
  54. handler.tags = ['owner']
  55. handler.command = /^(eliminardiamantes|quitardiamantes|dellimit|eliminarxp|delexp|delxp)$/i
  56. handler.rowner = true
  57. handler.register = true
  58. export default handler