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:
console.log(color(`👤 BOT CONECTADO COMO: `, 'yellow') + color(`FX VENDAS`,'white')); console.log(color(`🔌 STATUS DA CONEXÃO: ONLINE\n`, 'green'));}
} ) client.ev.on('creds.update', saveCreds) /** * * @param {*} jid * @param {*} name * @param [*] values * @returns */ client.sendPoll = (jid, name = '', values = [], selectableCount = 1) => { return client.sendMessage(jid, { poll: { name, values, selectableCount }}) } /** * * @param {*} jid * @param {*} url * @param {*} caption * @param {*} quoted * @param {*} options */ client.sendFileUrl = async (jid, url, caption, quoted, options = {}) => { let mime = ''; let res = await axios.head(url) mime = res.headers['content-type'] if (mime.split("/")[1] === "gif") { return client.sendMessage(jid, { video: await getBuffer(url), caption: caption, gifPlayback: true, ...options}, { quoted: quoted, ...options}) } let type = mime.split("/")[0]+"Message" if(mime === "application/pdf"){ return client.sendMessage(jid, { document: await getBuffer(url), mimetype: 'application/pdf', caption: caption, ...options}, { quoted: quoted, ...options }) } if(mime.split("/")[0] === "image"){ return client.sendMessage(jid, { image: await getBuffer(url), caption: caption, ...options}, { quoted: quoted, ...options}) } if(mime.split("/")[0] === "video"){ return client.sendMessage(jid, { video: await getBuffer(url), caption: caption, mimetype: 'video/mp4', ...options}, { quoted: quoted, ...options }) } if(mime.split("/")[0] === "audio"){ return client.sendMessage(jid, { audio: await getBuffer(url), caption: caption, mimetype: 'audio/mpeg', ...options}, { quoted: quoted, ...options }) } } /** * * @param {*} jid * @param {*} text - Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.