Reorganize este código JS mantendo a lógica, mas melhorando a estrutura:…
- User
Reorganize este código JS mantendo a lógica, mas melhorando a estrutura:
codeclient.appenTextMessage(prefCmd, chatUpdate) } } } }) client.ev.on('group-participants.update', async (anu) => { try { let metadata = await client.groupMetadata(anu.id) let participants = anu.participants for (let num of participants) { try { ppuser = await client.profilePictureUrl(num, 'image') } catch { ppuser = 'https://tinyurl.com/yx93l6da' } try { ppgroup = await client.profilePictureUrl(anu.id, 'image') } catch { ppgroup = 'https://tinyurl.com/yx93l6da' } if (anu.action == 'add') { client.sendMessage(anu.id, { image: { url: ppuser }, mentions: [num], caption: `Bemvindo a ${metadata.subject} @${num.split("@")[0]}` }) } else if (anu.action == 'remove') { client.sendMessage(anu.id, { image: { url: ppuser }, mentions: [num], caption: `@${num.split("@")[0]} Saiu de ${metadata.subject}` }) } else if (anu.action == 'promote') { client.sendMessage(anu.id, { image: { url: ppuser }, mentions: [num], caption: `@${num.split('@')[0]} promovido em ${metadata.subject}` }) } else if (anu.action == 'demote') { client.sendMessage(anu.id, { image: { url: ppuser }, mentions: [num], caption: `@${num.split('@')[0]} rebaixado em ${metadata.subject}` }) } } } catch (err) { console.log(err) } }) client.decodeJid = (jid) => { if (!jid) return jid if (/:\d+@/gi.test(jid)) { let decode = jidDecode(jid) || {} return decode.user && decode.server && decode.user + '@' + decode.server || jid } else return jid } client.ev.on('contacts.update', update => { - Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.