const items = ['limit', 'exp', 'joincount', 'money', 'potion', 'trash', 'wood', 'rock', 'string', 'petFood', 'emerald', 'diamond', 'gold', 'iron', 'common', 'uncoommon', 'mythic', 'legendary', 'pet', ] let confirmation = {} async function handler(m, { conn, args, usedPrefix, command }) { if (confirmation[m.sender]) return m.reply('๐™€๐™จ๐™ฉ๐™–๐™จ ๐™๐™–๐™˜๐™ž๐™š๐™ฃ๐™™๐™ค ๐™ช๐™ฃ๐™– ๐™ฉ๐™ง๐™–๐™ฃ๐™จ๐™›๐™š๐™ง๐™š๐™ฃ๐™˜๐™ž๐™–') let user = global.db.data.users[m.sender] const item = items.filter(v => v in user && typeof user[v] == 'number') let lol = `\`โงผโงผโงผ ๐Ÿ’ฑ ๐™๐™๐˜ผ๐™‰๐™Ž๐™๐™€๐™๐™€๐™‰๐˜พ๐™„๐˜ผ ๐Ÿ’ฑ โงฝโงฝโงฝ\` > *${usedPrefix + command} tipo cantidad @tag* \`โ ๐™€๐™…๐™€๐™ˆ๐™‹๐™‡๐™Š :\` * *${usedPrefix + command} exp 30 @0* โ”โ€ขใ€Œ *โœ… ๐™๐™€๐˜พ๐™๐™๐™Ž๐™Š๐™Ž ๐˜ฟ๐™„๐™Ž๐™‹๐™Š๐™‰๐™„๐˜ฝ๐™‡๐™€๐™Ž* ใ€ โ”ƒ โ”ƒ ๐Ÿ’Ž ๐˜ฟ๐™ž๐™–๐™ข๐™–๐™ฃ๐™ฉ๐™š๐™จ = limit โ”ƒ ๐Ÿช™ ๐Š๐š๐ง๐ญ๐ฎ๐˜พ๐™ค๐™ž๐™ฃ๐™จ = money โ”ƒ โšก ๐™€๐™ญ๐™ฅ๐™š๐™ง๐™ž๐™š๐™ฃ๐™˜๐™ž๐™– = exp โ”—โ€ข`.trim() const type = (args[0] || '').toLowerCase() if (!item.includes(type)) return m.reply(lol, m.chat, {mentions: conn.parseMention(lol)}, {quoted: m }) const count = Math.min(Number.MAX_SAFE_INTEGER, Math.max(1, (isNumber(args[1]) ? parseInt(args[1]) : 1))) * 1 let who = m.mentionedJid && m.mentionedJid[0] ? m.mentionedJid[0] : args[2] ? (args[2].replace(/[@ .+-]/g, '') + '@s.whatsapp.net') : '' if (!who) return m.reply(`${ag} *๐™€๐™๐™„๐™Œ๐™๐™€๐™๐™€ ๐˜ผ๐™‡ ๐™๐™Ž๐™๐˜ผ๐™๐™„๐™Š*`) if (!(who in global.db.data.users)) return m.reply(`${fg}*๐™€๐™‡ ๐™๐™Ž๐™๐˜ผ๐™๐™„๐™Š ${who} ๐™‰๐™Š ๐™Ž๐™€ ๐™€๐™‰๐˜พ๐™๐™€๐™‰๐™๐™๐˜ผ ๐™€๐™‰ ๐™ˆ๐™„ ๐˜ฝ๐˜ผ๐™Ž๐™€ ๐˜ฟ๐™€ ๐˜ฟ๐˜ผ๐™๐™Š๐™Ž*`) if (user[type] * 1 < count) return m.reply(`${fg}*๐™‰๐™Š ๐™๐™„๐™€๐™‰๐™€ ๐™Ž๐™๐™๐™๐˜พ๐™„๐™€๐™‰๐™๐™€ ๐™‹๐˜ผ๐™๐˜ผ ๐™๐™€๐˜ผ๐™‡๐™„๐™•๐˜ผ๐™ ๐™‡๐˜ผ ๐™๐™๐˜ผ๐™‰๐™Ž๐™๐™€๐™๐™€๐™‰๐˜พ๐™„๐˜ผ ๐˜ฟ๐™€ ${type}*`) let mentionedJid = [who] let username = conn.getName(who) let confirm = `\`ESTAS A PUNTO DE HACER ESTA ACCIร“N DE TRANFERENCIA\` > ๐Ÿ’น *${count} ${type} para* *@${(who || '').replace(/@s\.whatsapp\.net/g, '')}* ? \`DESEAS CONTINUAR?\` > Tienes 60 segundos!! > Escriba: (si) para acertar > escriba: (no) para cancelar\n\n> ${wm}`.trim() let c = `${wm}\nTienes 60 segundos!!` await conn.reply(m.chat, confirm, m, { mentions: [who] }) //conn.sendButton(m.chat, confirm, c, null, [['๐™Ž๐™„'], ['๐™‰๐™Š']], m, { mentions: [who] }) confirmation[m.sender] = {sender: m.sender, to: who, message: m, type, count, timeout: setTimeout(() => (m.reply('*SU TIEMPO SE HA TERMINADO*'), delete confirmation[m.sender]), 60 * 1000)}} handler.before = async m => { if (m.isBaileys) return if (!(m.sender in confirmation)) return if (!m.text) return let { timeout, sender, message, to, type, count } = confirmation[m.sender] if (m.id === message.id) return let user = global.db.data.users[sender] let _user = global.db.data.users[to] if (/^No|no$/i.test(m.text) ) { //if (/No?/m.text(m.text.toLowerCase())) { clearTimeout(timeout) delete confirmation[sender] return m.reply('*CANCELADO*') } if (/^Si|si$/i.test(m.text) ) { //if (/Si?/m.text(m.text.toLowerCase())) { let previous = user[type] * 1 let _previous = _user[type] * 1 user[type] -= count * 1 _user[type] += count * 1 if (previous > user[type] * 1 && _previous < _user[type] * 1) m.reply(`โœ… *TRANSFERENCIA HECHA CON ร‰XITO:*\n\n*${count} ${type} para* @${(to || '').replace(/@s\.whatsapp\.net/g, '')}`, null, { mentions: [to] }) else { user[type] = previous _user[type] = _previous m.reply(`*Error al transferir ${count} ${type} para* *@${(to || '').replace(/@s\.whatsapp\.net/g, '')}*`, null, { mentions: [to] }) } clearTimeout(timeout) delete confirmation[sender] }} handler.help = ['transfer'].map(v => v + ' [tipo] [cantidad] [@tag]') handler.tags = ['econ']; handler.command = ['payxp', 'transfer', 'darxp', 'dar', 'enviar', 'transferir'] handler.disabled = false handler.register = true export default handler function special(type) { let b = type.toLowerCase() let special = (['common', 'uncoommon', 'mythic', 'legendary', 'pet'].includes(b) ? ' Crate' : '') return special } function isNumber(x) { return !isNaN(x) }