| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- 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)
- }
|