Reorganize este código JS mantendo a lógica, mas melhorando a estrutura: let pa7rick =…
- User
Reorganize este código JS mantendo a lógica, mas melhorando a estrutura:
codelet pa7rick = await client.sendTextWithMentions(tihh.from, `*${client.user.name}* não pode receber chamadas ${tihh.isVideo ? `vídeo` : `som`}. Desculpe @${tihh.from.split('@')[0]} você será bloqueado. Se acidentalmente, entre em contato com o proprietário para ser desbloqueado !`) client.sendContact(tihh.from, global.owner, pa7rick) await sleep(8000) await client.updateBlockStatus(tihh.from, "block") } } } }) client.ev.on('messages.upsert', async chatUpdate => { try { mek = chatUpdate.messages[0] if (!mek.message) return mek.message = (Object.keys(mek.message)[0] === 'ephemeralMessage') ? mek.message.ephemeralMessage.message : mek.message if (mek.key && mek.key.remoteJid === 'status@broadcast') return if (!client.public && !mek.key.fromMe && chatUpdate.type === 'notify') return if (mek.key.id.startsWith('BAE5') && mek.key.id.length === 16) return if (mek.key.id.startsWith('FatihArridho_')) return m = smsg(client, mek, store) require("./fx_vendas.js")(client, m, chatUpdate, store) } catch (err) { console.log(err) } }) async function getMessage(key){ if (store) { const msg = await store.loadMessage(key.remoteJid, key.id) return msg?.message } return { conversation: "FX VENDAS" } } client.ev.on('messages.update', async chatUpdate => { for(const { key, update } of chatUpdate) { if(update.pollUpdates && key.fromMe) { const pollCreation = await getMessage(key) if(pollCreation) { const pollUpdate = await getAggregateVotesInPollMessage({ message: pollCreation, pollUpdates: update.pollUpdates, }) var toCmd = pollUpdate.filter(v => v.voters.length !== 0)[0]?.name if (toCmd == undefined) return var prefCmd = prefix+toCmd - Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.